Go API 參考文件
計算訊息中的 Token 數
client.Messages.CountTokens(ctx, params) (*MessageTokensCount, error)POST/v1/messages/count_tokens
計算訊息中的 Token 數量。
建立使用者設定檔
client.UserProfiles.New(ctx, params) (*UserProfile, error)POST/v1/user_profiles
註冊您的一位終端客戶,並取得 ID,以便在您代其發出的請求中傳送。
列出使用者設定檔
client.UserProfiles.List(ctx, params) (*PageCursor[UserProfile], error)GET/v1/user_profiles
列出您組織中的使用者設定檔,預設以最新的優先排列。
取得使用者設定檔
client.UserProfiles.Get(ctx, userProfileID, query) (*UserProfile, error)GET/v1/user_profiles/{user_profile_id}
依 ID 取得使用者設定檔,以檢查為其儲存的詳細資訊。
更新使用者設定檔
client.UserProfiles.Update(ctx, userProfileID, params) (*UserProfile, error)POST/v1/user_profiles/{user_profile_id}
變更使用者設定檔的詳細資訊,您未傳送的欄位將維持不變。
刪除使用者設定檔
client.UserProfiles.Delete(ctx, userProfileID, body) (*DeletedUserProfile, error)DELETE/v1/user_profiles/{user_profile_id}
刪除使用者設定檔,例如在終端客戶關閉其帳戶時。
取得目前組織
client.Organization.Get(ctx) (*OrganizationInfo, error)GET/v1/organizations/me
擷取與已驗證 API 金鑰相關聯之組織的資訊。