Python-API-Referenz
Eine Nachricht erstellen
messages.create(**kwargs) -> MessageSende eine strukturierte Liste von Eingabenachrichten mit Text- und/oder Bildinhalten, und das Modell generiert die nächste Nachricht in der Konversation.
Tokens in einer Nachricht zählen
messages.count_tokens(**kwargs) -> MessageTokensCountZähle die Anzahl der Tokens in einer Nachricht.
Modelle auflisten
models.list(**kwargs) -> SyncPage[ModelInfo]Liste verfügbare Modelle auf.
Ein Modell abrufen
models.retrieve(model_id, **kwargs) -> ModelInfoRufe ein bestimmtes Modell ab.
Datei herunterladen
files.download(file_id, **kwargs) -> BinaryResponseContentDateimetadaten abrufen
files.retrieve_metadata(file_id, **kwargs) -> FileMetadataBenutzerprofile
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.
Benutzerprofil erstellen
user_profiles.create(**kwargs) -> UserProfileRegister one of your end customers and get the ID to send on the requests you make for them.
Benutzerprofile auflisten
user_profiles.list(**kwargs) -> SyncPageCursor[UserProfile]List the user profiles in your organization, newest first by default.
Benutzerprofil abrufen
user_profiles.retrieve(user_profile_id, **kwargs) -> UserProfileGet a user profile by ID to check the details stored for it.
Benutzerprofil aktualisieren
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.
Benutzerprofil löschen
user_profiles.delete(user_profile_id, **kwargs) -> DeletedUserProfileDelete a user profile, for example when the end customer closes their account.
Aktuelle Organisation abrufen
organization.retrieve() -> OrganizationInfoRuft Informationen über die Organisation ab, die mit dem authentifizierten API-Key verknüpft ist.