Riferimento API Python
Crea un messaggio
messages.create(**kwargs) -> MessageInvia un elenco strutturato di messaggi di input con contenuto testuale e/o immagini, e il modello genererà il messaggio successivo nella conversazione.
Conta i token in un messaggio
messages.count_tokens(**kwargs) -> MessageTokensCountConta il numero di token in un messaggio.
Elenca i modelli
models.list(**kwargs) -> SyncPage[ModelInfo]Elenca i modelli disponibili.
Ottieni un modello
models.retrieve(model_id, **kwargs) -> ModelInfoOttieni un modello specifico.
Scarica file
files.download(file_id, **kwargs) -> BinaryResponseContentOttieni metadati del file
files.retrieve_metadata(file_id, **kwargs) -> FileMetadataProfili utente
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.
Crea profilo utente
user_profiles.create(**kwargs) -> UserProfileRegister one of your end customers and get the ID to send on the requests you make for them.
Elenca profili utente
user_profiles.list(**kwargs) -> SyncPageCursor[UserProfile]List the user profiles in your organization, newest first by default.
Ottieni profilo utente
user_profiles.retrieve(user_profile_id, **kwargs) -> UserProfileGet a user profile by ID to check the details stored for it.
Aggiorna profilo utente
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.
Elimina profilo utente
user_profiles.delete(user_profile_id, **kwargs) -> DeletedUserProfileDelete a user profile, for example when the end customer closes their account.
Ottieni l'organizzazione corrente
organization.retrieve() -> OrganizationInfoRecupera le informazioni sull'organizzazione associata alla chiave API autenticata.