Claude Platform Docs

Referencia de API de Python

Crear un mensaje
messages.create(**kwargs) -> Message
POST/v1/messages

Envía una lista estructurada de mensajes de entrada con contenido de texto o imágenes, y el modelo generará el siguiente mensaje de la conversación.

Contar tokens en un mensaje
messages.count_tokens(**kwargs) -> MessageTokensCount
POST/v1/messages/count_tokens

Cuenta el número de tokens en un mensaje.

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

Lista los modelos disponibles.

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

Obtiene un modelo específico.

Cargar archivo
files.upload(**kwargs) -> FileMetadata
POST/v1/files
Listar archivos
files.list(**kwargs) -> SyncPageCursor[FileMetadata]
GET/v1/files
Descargar archivo
files.download(file_id, **kwargs) -> BinaryResponseContent
GET/v1/files/{file_id}/content
Obtener metadatos de archivo
files.retrieve_metadata(file_id, **kwargs) -> FileMetadata
GET/v1/files/{file_id}
Eliminar archivo
files.delete(file_id, **kwargs) -> DeletedFile
DELETE/v1/files/{file_id}
Crear Skill
skills.create(**kwargs) -> Skill
POST/v1/skills
Listar Skills
skills.list(**kwargs) -> SyncPageCursor[Skill]
GET/v1/skills
Obtener Skill
skills.retrieve(skill_id, **kwargs) -> Skill
GET/v1/skills/{skill_id}
Eliminar Skill
skills.delete(skill_id, **kwargs) -> DeletedSkill
DELETE/v1/skills/{skill_id}

Perfiles de usuario

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.

Crear perfil de usuario
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 perfiles de usuario
user_profiles.list(**kwargs) -> SyncPageCursor[UserProfile]
GET/v1/user_profiles

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

Obtener perfil de usuario
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.

Actualizar perfil de usuario
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.

Eliminar perfil de usuario
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.

Obtener la organización actual
organization.retrieve() -> OrganizationInfo
GET/v1/organizations/me

Recupera información sobre la organización asociada con la clave de API autenticada.