TypeScript API reference
Create a Message
client.messages.create(params, options?): Message | Stream<RawMessageStreamEvent>Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
Count tokens in a Message
client.messages.countTokens(params, options?): MessageTokensCountCount the number of tokens in a Message.
List Models
client.models.list(params?, options?): Page<ModelInfo>List available models.
Get a Model
client.models.retrieve(modelID, params?, options?): ModelInfoGet a specific model.
Download File
client.files.download(fileID, params?, options?): ResponseGet File Metadata
client.files.retrieveMetadata(fileID, params?, options?): FileMetadataDelete Skill
client.skills.delete(skillID, params?, options?): DeletedSkillUser Profiles
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.
Create User Profile
client.userProfiles.create(params, options?): UserProfileRegister one of your end customers and get the ID to send on the requests you make for them.
List User Profiles
client.userProfiles.list(params?, options?): PageCursor<UserProfile>List the user profiles in your organization, newest first by default.
Get User Profile
client.userProfiles.retrieve(userProfileID, params?, options?): UserProfileGet a user profile by ID to check the details stored for it.
Update User Profile
client.userProfiles.update(userProfileID, params, options?): UserProfileChange the details of a user profile, leaving the fields that you don't send as they are.
Delete User Profile
client.userProfiles.delete(userProfileID, params?, options?): DeletedUserProfileDelete a user profile, for example when the end customer closes their account.
Get Current Organization
client.organization.retrieve(options?): OrganizationInfoRetrieve information about the organization associated with the authenticated API key.