Python API reference
Create a Message
messages.create(**kwargs) -> MessagePOST/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
messages.count_tokens(**kwargs) -> MessageTokensCountPOST/v1/messages/count_tokens
Count the number of tokens in a Message.
Get a Model
models.retrieve(model_id, **kwargs) -> ModelInfoGET/v1/models/{model_id}
Get a specific model.
Download File
files.download(file_id, **kwargs) -> BinaryResponseContentGET/v1/files/{file_id}/content
Get Current Organization
organization.retrieve() -> OrganizationInfoGET/v1/organizations/me
Retrieve information about the organization associated with the authenticated API key.