Referência da API para Python
Criar uma mensagem
messages.create(**kwargs) -> MessageEnvie 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) -> MessageTokensCountConte o número de tokens em uma mensagem.
Listar modelos
models.list(**kwargs) -> SyncPage[ModelInfo]Liste os modelos disponíveis.
Obter um modelo
models.retrieve(model_id, **kwargs) -> ModelInfoObtenha um modelo específico.
Baixar arquivo
files.download(file_id, **kwargs) -> BinaryResponseContentObter metadados do arquivo
files.retrieve_metadata(file_id, **kwargs) -> FileMetadataPerfis 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) -> UserProfileRegister 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]List the user profiles in your organization, newest first by default.
Obter perfil de usuário
user_profiles.retrieve(user_profile_id, **kwargs) -> UserProfileGet a user profile by ID to check the details stored for it.
Atualizar perfil de usuário
user_profiles.update(user_profile_id, **kwargs) -> UserProfileChange 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) -> DeletedUserProfileDelete a user profile, for example when the end customer closes their account.
Obter organização atual
organization.retrieve() -> OrganizationInfoRecupere informações sobre a organização associada à chave de API autenticada.