Go API 参考
计算消息中的令牌数
client.Messages.CountTokens(ctx, params) (*MessageTokensCount, error)POST/v1/messages/count_tokens
计算消息中的令牌数量。
创建用户配置文件
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 密钥关联的组织的信息。