Claude Platform Docs

Python-API-Referenz

Eine Nachricht erstellen
messages.create(**kwargs) -> Message
POST/v1/messages

Sende 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) -> MessageTokensCount
POST/v1/messages/count_tokens

Zähle die Anzahl der Tokens in einer Nachricht.

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

Liste verfügbare Modelle auf.

Ein Modell abrufen
models.retrieve(model_id, **kwargs) -> ModelInfo
GET/v1/models/{model_id}

Rufe ein bestimmtes Modell ab.

Datei hochladen
files.upload(**kwargs) -> FileMetadata
POST/v1/files
Dateien auflisten
files.list(**kwargs) -> SyncPageCursor[FileMetadata]
GET/v1/files
Datei herunterladen
files.download(file_id, **kwargs) -> BinaryResponseContent
GET/v1/files/{file_id}/content
Dateimetadaten abrufen
files.retrieve_metadata(file_id, **kwargs) -> FileMetadata
GET/v1/files/{file_id}
Datei löschen
files.delete(file_id, **kwargs) -> DeletedFile
DELETE/v1/files/{file_id}
Skill erstellen
skills.create(**kwargs) -> Skill
POST/v1/skills
Skills auflisten
skills.list(**kwargs) -> SyncPageCursor[Skill]
GET/v1/skills
Skill abrufen
skills.retrieve(skill_id, **kwargs) -> Skill
GET/v1/skills/{skill_id}
Skill löschen
skills.delete(skill_id, **kwargs) -> DeletedSkill
DELETE/v1/skills/{skill_id}

Benutzerprofile

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) -> UserProfile
POST/v1/user_profiles

Register 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]
GET/v1/user_profiles

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

Benutzerprofil abrufen
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.

Benutzerprofil aktualisieren
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.

Benutzerprofil löschen
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.

Aktuelle Organisation abrufen
organization.retrieve() -> OrganizationInfo
GET/v1/organizations/me

Ruft Informationen über die Organisation ab, die mit dem authentifizierten API-Key verknüpft ist.