TypeScript API 參考文件
建立訊息
client.messages.create(params, options?): Message | Stream<RawMessageStreamEvent>POST/v1/messages
傳送包含文字和/或圖片內容的結構化輸入訊息清單,模型將產生對話中的下一則訊息。
計算訊息中的 Token 數
client.messages.countTokens(params, options?): MessageTokensCountPOST/v1/messages/count_tokens
計算訊息中的 Token 數量。
取得檔案中繼資料
client.files.retrieveMetadata(fileID, params?, options?): FileMetadataGET/v1/files/{file_id}
取得使用者設定檔
client.userProfiles.retrieve(userProfileID, params?, options?): UserProfileGET/v1/user_profiles/{user_profile_id}
更新使用者設定檔
client.userProfiles.update(userProfileID, params, options?): UserProfilePOST/v1/user_profiles/{user_profile_id}
刪除使用者設定檔
client.userProfiles.delete(userProfileID, params?, options?): DeletedUserProfileDELETE/v1/user_profiles/{user_profile_id}
取得目前組織
client.organization.retrieve(options?): OrganizationInfoGET/v1/organizations/me
擷取與已驗證 API 金鑰相關聯之組織的資訊。