PHP API リファレンス
メッセージを作成
$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
テキストや画像コンテンツを含む入力メッセージの構造化されたリストを送信すると、モデルが会話内の次のメッセージを生成します。
メッセージ内のトークンをカウント
$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
メッセージ内のトークン数をカウントします。
ファイルをアップロード
$client->files->upload(FileParam | string file, ?int expiresInSeconds, ?string workspaceID): FileMetadataPOST/v1/files
ファイルの一覧
$client->files->list(?list<string> ids, ?int limit, ?string page, ?string workspaceID): PageCursor<FileMetadata>GET/v1/files
ファイルをダウンロード
$client->files->download(string fileID, ?string workspaceID): downloadGET/v1/files/{file_id}/content
ファイルのメタデータを取得
$client->files->retrieveMetadata(string fileID, ?string workspaceID): FileMetadataGET/v1/files/{file_id}
ファイルを削除
$client->files->delete(string fileID, ?string workspaceID): DeletedFileDELETE/v1/files/{file_id}
スキルを削除
$client->skills->delete(string skillID, ?string workspaceID): DeletedSkillDELETE/v1/skills/{skill_id}
ユーザープロファイルを作成
$client->userProfiles->create(?UserProfileAccessType accessType, ?UserProfileExternalUserDetailsParams externalUserDetails, ?array<string,string> metadata, ?string name, ?string workspaceID): UserProfilePOST/v1/user_profiles
ユーザープロファイルの一覧を取得
$client->userProfiles->list(?list<UserProfileEnforcementStatus> enforcementStatus, ?int limit, ?UserProfileListOrder order, ?UserProfileListOrderBy orderBy, ?string page, ?string workspaceID): PageCursor<UserProfile>GET/v1/user_profiles
ユーザープロファイルを取得
$client->userProfiles->retrieve(string userProfileID, ?string workspaceID): UserProfileGET/v1/user_profiles/{user_profile_id}
ユーザープロファイルを更新
$client->userProfiles->update(string userProfileID, ?UserProfileAccessType accessType, ?UserProfileExternalUserDetailsParams externalUserDetails, ?array<string,string> metadata, ?string name, ?string workspaceID): UserProfilePOST/v1/user_profiles/{user_profile_id}
ユーザープロファイルを削除
$client->userProfiles->delete(string userProfileID, ?string workspaceID): DeletedUserProfileDELETE/v1/user_profiles/{user_profile_id}
現在の組織を取得
$client->organization->retrieve(): OrganizationInfoGET/v1/organizations/me
認証されたAPIキーに関連付けられた組織に関する情報を取得します。