Python API 參考文件
計算訊息中的 Token 數
messages.count_tokens(**kwargs) -> MessageTokensCountPOST/v1/messages/count_tokens
計算訊息中的 Token 數量。
使用者設定檔
Register the end customers that your platform serves, so each request can name who it's for. To get started, see the User profiles guide.
建立使用者設定檔
user_profiles.create(**kwargs) -> UserProfilePOST/v1/user_profiles
Register one of your end customers and get the ID to send on the requests you make for them.
列出使用者設定檔
user_profiles.list(**kwargs) -> SyncPageCursor[UserProfile]GET/v1/user_profiles
List the user profiles in your organization, newest first by default.
取得使用者設定檔
user_profiles.retrieve(user_profile_id, **kwargs) -> UserProfileGET/v1/user_profiles/{user_profile_id}
Get a user profile by ID to check the details stored for it.
更新使用者設定檔
user_profiles.update(user_profile_id, **kwargs) -> UserProfilePOST/v1/user_profiles/{user_profile_id}
Change the details of a user profile, leaving the fields that you don't send as they are.
刪除使用者設定檔
user_profiles.delete(user_profile_id, **kwargs) -> DeletedUserProfileDELETE/v1/user_profiles/{user_profile_id}
Delete a user profile, for example when the end customer closes their account.