Claude Platform Docs

Java API 參考文件

建立訊息
Message messages().create(params, requestOptions = RequestOptions.none())
POST/v1/messages

傳送包含文字和/或圖片內容的結構化輸入訊息清單,模型將產生對話中的下一則訊息。

計算訊息中的 Token 數
MessageTokensCount messages().countTokens(params, requestOptions = RequestOptions.none())
POST/v1/messages/count_tokens

計算訊息中的 Token 數量。

列出模型
ModelListPage models().list(params = ModelListParams.none(), requestOptions = RequestOptions.none())
GET/v1/models

列出可用的模型。

取得模型
ModelInfo models().retrieve(params = ModelRetrieveParams.none(), requestOptions = RequestOptions.none())
GET/v1/models/{model_id}

取得特定模型。

上傳檔案
FileMetadata files().upload(params, requestOptions = RequestOptions.none())
POST/v1/files
列出檔案
FileListPage files().list(params = FileListParams.none(), requestOptions = RequestOptions.none())
GET/v1/files
下載檔案
HttpResponse files().download(params = FileDownloadParams.none(), requestOptions = RequestOptions.none())
GET/v1/files/{file_id}/content
取得檔案中繼資料
FileMetadata files().retrieveMetadata(params = FileRetrieveMetadataParams.none(), requestOptions = RequestOptions.none())
GET/v1/files/{file_id}
刪除檔案
DeletedFile files().delete(params = FileDeleteParams.none(), requestOptions = RequestOptions.none())
DELETE/v1/files/{file_id}
建立技能
Skill skills().create(params, requestOptions = RequestOptions.none())
POST/v1/skills
列出技能
SkillListPage skills().list(params = SkillListParams.none(), requestOptions = RequestOptions.none())
GET/v1/skills
取得技能
Skill skills().retrieve(params = SkillRetrieveParams.none(), requestOptions = RequestOptions.none())
GET/v1/skills/{skill_id}
刪除技能
DeletedSkill skills().delete(params = SkillDeleteParams.none(), requestOptions = RequestOptions.none())
DELETE/v1/skills/{skill_id}

使用者設定檔

註冊您的平台所服務的終端客戶,讓每個請求都能指明其服務對象。若要開始使用,請參閱使用者設定檔指南。

建立使用者設定檔
UserProfile userProfiles().create(params = UserProfileCreateParams.none(), requestOptions = RequestOptions.none())
POST/v1/user_profiles

註冊您的一位終端客戶,並取得 ID,以便在您代其發出的請求中傳送。

列出使用者設定檔
UserProfileListPage userProfiles().list(params = UserProfileListParams.none(), requestOptions = RequestOptions.none())
GET/v1/user_profiles

列出您組織中的使用者設定檔,預設以最新的優先排列。

取得使用者設定檔
UserProfile userProfiles().retrieve(params = UserProfileRetrieveParams.none(), requestOptions = RequestOptions.none())
GET/v1/user_profiles/{user_profile_id}

依 ID 取得使用者設定檔,以檢查為其儲存的詳細資訊。

更新使用者設定檔
UserProfile userProfiles().update(params = UserProfileUpdateParams.none(), requestOptions = RequestOptions.none())
POST/v1/user_profiles/{user_profile_id}

變更使用者設定檔的詳細資訊,您未傳送的欄位將維持不變。

刪除使用者設定檔
DeletedUserProfile userProfiles().delete(params = UserProfileDeleteParams.none(), requestOptions = RequestOptions.none())
DELETE/v1/user_profiles/{user_profile_id}

刪除使用者設定檔,例如在終端客戶關閉其帳戶時。

取得目前組織
OrganizationInfo organization().retrieve(params = OrganizationRetrieveParams.none(), requestOptions = RequestOptions.none())
GET/v1/organizations/me

擷取與已驗證 API 金鑰相關聯之組織的資訊。