TypeScript API reference
Create a Text Completion
Deprecated
client.completions.create(params, options?): Completion | Stream<Completion>POST/v1/complete
[Legacy] Create a Text Completion.
Create a Message
client.messages.create(params, options?): Message | Stream<RawMessageStreamEvent>POST/v1/messages
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?): MessageTokensCountPOST/v1/messages/count_tokens
Count the number of tokens in a Message.
List Models
client.models.list(params?, options?): Page<ModelInfo>GET/v1/models
List available models.
Get a Model
client.models.retrieve(modelID, params?, options?): ModelInfoGET/v1/models/{model_id}
Get a specific model.
Download File
client.files.download(fileID, params?, options?): ResponseGET/v1/files/{file_id}/content
Get File Metadata
client.files.retrieveMetadata(fileID, params?, options?): FileMetadataGET/v1/files/{file_id}
Delete Skill
client.skills.delete(skillID, params?, options?): DeletedSkillDELETE/v1/skills/{skill_id}
Get Current Organization
client.organization.retrieve(options?): OrganizationInfoGET/v1/organizations/me
Retrieve information about the organization associated with the authenticated API key.