Referensi API PHP
Buat Pesan
$client->messages->create(int maxTokens, list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?MessageCreateParamsContainer container, ?DiagnosticsParam diagnostics, ?string inferenceGeo, ?Metadata metadata, ?OutputConfig outputConfig, ?ServiceTier serviceTier, ?Speed speed, ?list<string> stopSequences, ?System system, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<ToolUnion> tools, ?string userProfileID, ?string workspaceID): MessagePOST/v1/messages
Kirim daftar terstruktur pesan input yang berisi konten teks dan/atau gambar, dan model akan menghasilkan pesan berikutnya dalam percakapan.
Hitung token dalam Pesan
$client->messages->countTokens(list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?OutputConfig outputConfig, ?Speed speed, ?System system, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<MessageCountTokensTool> tools, ?string userProfileID, ?string workspaceID): MessageTokensCountPOST/v1/messages/count_tokens
Hitung jumlah token dalam sebuah Message.
Daftar Model
$client->models->list(?string afterID, ?string beforeID, ?list<Lifecycle> lifecycle, ?int limit, ?string workspaceID): Page<ModelInfo>GET/v1/models
Daftar model yang tersedia.
Dapatkan Model
$client->models->retrieve(string modelID, ?string workspaceID): ModelInfoGET/v1/models/{model_id}
Dapatkan model tertentu.
Unggah File
$client->files->upload(FileParam | string file, ?int expiresInSeconds, ?string workspaceID): FileMetadataPOST/v1/files
Daftar File
$client->files->list(?list<string> ids, ?int limit, ?string page, ?string workspaceID): PageCursor<FileMetadata>GET/v1/files
Unduh File
$client->files->download(string fileID, ?string workspaceID): downloadGET/v1/files/{file_id}/content
Dapatkan Metadata File
$client->files->retrieveMetadata(string fileID, ?string workspaceID): FileMetadataGET/v1/files/{file_id}
Hapus File
$client->files->delete(string fileID, ?string workspaceID): DeletedFileDELETE/v1/files/{file_id}
Buat Skill
$client->skills->create(list<FileParam | string> files, ?string displayName, ?string workspaceID): SkillPOST/v1/skills
Daftar Skill
$client->skills->list(?int limit, ?string page, ?string source, ?string workspaceID): PageCursor<Skill>GET/v1/skills
Dapatkan Skill
$client->skills->retrieve(string skillID, ?string workspaceID): SkillGET/v1/skills/{skill_id}
Hapus Skill
$client->skills->delete(string skillID, ?string workspaceID): DeletedSkillDELETE/v1/skills/{skill_id}
Buat Profil Pengguna
$client->userProfiles->create(?UserProfileAccessType accessType, ?UserProfileExternalUserDetailsParams externalUserDetails, ?array<string,string> metadata, ?string name, ?string workspaceID): UserProfilePOST/v1/user_profiles
Daftar Profil Pengguna
$client->userProfiles->list(?list<UserProfileEnforcementStatus> enforcementStatus, ?int limit, ?UserProfileListOrder order, ?UserProfileListOrderBy orderBy, ?string page, ?string workspaceID): PageCursor<UserProfile>GET/v1/user_profiles
Dapatkan Profil Pengguna
$client->userProfiles->retrieve(string userProfileID, ?string workspaceID): UserProfileGET/v1/user_profiles/{user_profile_id}
Perbarui Profil Pengguna
$client->userProfiles->update(string userProfileID, ?UserProfileAccessType accessType, ?UserProfileExternalUserDetailsParams externalUserDetails, ?array<string,string> metadata, ?string name, ?string workspaceID): UserProfilePOST/v1/user_profiles/{user_profile_id}
Hapus Profil Pengguna
$client->userProfiles->delete(string userProfileID, ?string workspaceID): DeletedUserProfileDELETE/v1/user_profiles/{user_profile_id}
Dapatkan Organisasi Saat Ini
$client->organization->retrieve(): OrganizationInfoGET/v1/organizations/me
Ambil informasi tentang organisasi yang terkait dengan kunci API yang diautentikasi.