Claude Platform Docs

Python API reference

Create a Message
messages.create(**kwargs) -> Message
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
messages.count_tokens(**kwargs) -> MessageTokensCount
POST/v1/messages/count_tokens

Count the number of tokens in a Message.

List Models
models.list(**kwargs) -> SyncPage[ModelInfo]
GET/v1/models

List available models.

Get a Model
models.retrieve(model_id, **kwargs) -> ModelInfo
GET/v1/models/{model_id}

Get a specific model.

Upload File
files.upload(**kwargs) -> FileMetadata
POST/v1/files
List Files
files.list(**kwargs) -> SyncPageCursor[FileMetadata]
GET/v1/files
Download File
files.download(file_id, **kwargs) -> BinaryResponseContent
GET/v1/files/{file_id}/content
Get File Metadata
files.retrieve_metadata(file_id, **kwargs) -> FileMetadata
GET/v1/files/{file_id}
Delete File
files.delete(file_id, **kwargs) -> DeletedFile
DELETE/v1/files/{file_id}
Create Skill
skills.create(**kwargs) -> Skill
POST/v1/skills
List Skills
skills.list(**kwargs) -> SyncPageCursor[Skill]
GET/v1/skills
Get Skill
skills.retrieve(skill_id, **kwargs) -> Skill
GET/v1/skills/{skill_id}
Delete Skill
skills.delete(skill_id, **kwargs) -> DeletedSkill
DELETE/v1/skills/{skill_id}
Get Current Organization
organization.retrieve() -> OrganizationInfo
GET/v1/organizations/me

Retrieve information about the organization associated with the authenticated API key.