Claude Platform Docs

Referência da API para Python

Criar uma mensagem
messages.create(**kwargs) -> Message
POST/v1/messages

Envie uma lista estruturada de mensagens de entrada com conteúdo de texto e/ou imagem, e o modelo gerará a próxima mensagem na conversa.

Contar tokens em uma mensagem
messages.count_tokens(**kwargs) -> MessageTokensCount
POST/v1/messages/count_tokens

Conte o número de tokens em uma mensagem.

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

Liste os modelos disponíveis.

Obter um modelo
models.retrieve(model_id, **kwargs) -> ModelInfo
GET/v1/models/{model_id}

Obtenha um modelo específico.

Fazer upload de arquivo
files.upload(**kwargs) -> FileMetadata
POST/v1/files
Listar arquivos
files.list(**kwargs) -> SyncPageCursor[FileMetadata]
GET/v1/files
Baixar arquivo
files.download(file_id, **kwargs) -> BinaryResponseContent
GET/v1/files/{file_id}/content
Obter metadados do arquivo
files.retrieve_metadata(file_id, **kwargs) -> FileMetadata
GET/v1/files/{file_id}
Excluir arquivo
files.delete(file_id, **kwargs) -> DeletedFile
DELETE/v1/files/{file_id}
Criar skill
skills.create(**kwargs) -> Skill
POST/v1/skills
Listar skills
skills.list(**kwargs) -> SyncPageCursor[Skill]
GET/v1/skills
Obter skill
skills.retrieve(skill_id, **kwargs) -> Skill
GET/v1/skills/{skill_id}
Excluir skill
skills.delete(skill_id, **kwargs) -> DeletedSkill
DELETE/v1/skills/{skill_id}

Perfis de usuário

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.

Criar perfil de usuário
user_profiles.create(**kwargs) -> UserProfile
POST/v1/user_profiles

Register one of your end customers and get the ID to send on the requests you make for them.

Listar perfis de usuário
user_profiles.list(**kwargs) -> SyncPageCursor[UserProfile]
GET/v1/user_profiles

List the user profiles in your organization, newest first by default.

Obter perfil de usuário
user_profiles.retrieve(user_profile_id, **kwargs) -> UserProfile
GET/v1/user_profiles/{user_profile_id}

Get a user profile by ID to check the details stored for it.

Atualizar perfil de usuário
user_profiles.update(user_profile_id, **kwargs) -> UserProfile
POST/v1/user_profiles/{user_profile_id}

Change the details of a user profile, leaving the fields that you don't send as they are.

Excluir perfil de usuário
user_profiles.delete(user_profile_id, **kwargs) -> DeletedUserProfile
DELETE/v1/user_profiles/{user_profile_id}

Delete a user profile, for example when the end customer closes their account.

Obter organização atual
organization.retrieve() -> OrganizationInfo
GET/v1/organizations/me

Recupere informações sobre a organização associada à chave de API autenticada.