Claude Platform Docs

Riferimento API TypeScript

Crea un messaggio
client.messages.create(params, options?): Message | Stream<RawMessageStreamEvent>
POST/v1/messages

Invia 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
client.messages.countTokens(params, options?): MessageTokensCount
POST/v1/messages/count_tokens

Conta il numero di token in un messaggio.

Elenca i modelli
client.models.list(params?, options?): Page<ModelInfo>
GET/v1/models

Elenca i modelli disponibili.

Ottieni un modello
client.models.retrieve(modelID, params?, options?): ModelInfo
GET/v1/models/{model_id}

Ottieni un modello specifico.

Carica file
client.files.upload(params, options?): FileMetadata
POST/v1/files
Elenca i file
client.files.list(params?, options?): PageCursor<FileMetadata>
GET/v1/files
Scarica file
client.files.download(fileID, params?, options?): Response
GET/v1/files/{file_id}/content
Ottieni metadati del file
client.files.retrieveMetadata(fileID, params?, options?): FileMetadata
GET/v1/files/{file_id}
Elimina file
client.files.delete(fileID, params?, options?): DeletedFile
DELETE/v1/files/{file_id}
Crea skill
client.skills.create(params, options?): Skill
POST/v1/skills
Elenca le skill
client.skills.list(params?, options?): PageCursor<Skill>
GET/v1/skills
Ottieni skill
client.skills.retrieve(skillID, params?, options?): Skill
GET/v1/skills/{skill_id}
Elimina skill
client.skills.delete(skillID, params?, options?): DeletedSkill
DELETE/v1/skills/{skill_id}

Profili 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
client.userProfiles.create(params, options?): UserProfile
POST/v1/user_profiles

Register one of your end customers and get the ID to send on the requests you make for them.

Elenca profili utente
client.userProfiles.list(params?, options?): PageCursor<UserProfile>
GET/v1/user_profiles

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

Ottieni profilo utente
client.userProfiles.retrieve(userProfileID, params?, options?): UserProfile
GET/v1/user_profiles/{user_profile_id}

Get a user profile by ID to check the details stored for it.

Aggiorna profilo utente
client.userProfiles.update(userProfileID, params, options?): 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.

Elimina profilo utente
client.userProfiles.delete(userProfileID, params?, options?): DeletedUserProfile
DELETE/v1/user_profiles/{user_profile_id}

Delete a user profile, for example when the end customer closes their account.

Ottieni l'organizzazione corrente
client.organization.retrieve(options?): OrganizationInfo
GET/v1/organizations/me

Recupera le informazioni sull'organizzazione associata alla chiave API autenticata.