Claude Platform Docs

TypeScript API reference

Buat Text Completion
Deprecated
client.completions.create(params, options?): Completion | Stream<Completion>
POST/v1/complete

[Legacy] Buat Text Completion.

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

Kirim daftar terstruktur pesan input yang berisi konten teks dan/atau gambar, dan model akan menghasilkan pesan berikutnya dalam percakapan.

Hitung token dalam Message
client.messages.countTokens(params, options?): MessageTokensCount
POST/v1/messages/count_tokens

Hitung jumlah token dalam sebuah Message.

Daftar Model
client.models.list(params?, options?): Page<ModelInfo>
GET/v1/models

Daftar model yang tersedia.

Dapatkan Model
client.models.retrieve(modelID, params?, options?): ModelInfo
GET/v1/models/{model_id}

Dapatkan model tertentu.

Unggah File
client.files.upload(params, options?): FileMetadata
POST/v1/files
Daftar File
client.files.list(params?, options?): PageCursor<FileMetadata>
GET/v1/files
Unduh File
client.files.download(fileID, params?, options?): Response
GET/v1/files/{file_id}/content
Dapatkan Metadata File
client.files.retrieveMetadata(fileID, params?, options?): FileMetadata
GET/v1/files/{file_id}
Hapus File
client.files.delete(fileID, params?, options?): DeletedFile
DELETE/v1/files/{file_id}
Buat Skill
client.skills.create(params, options?): Skill
POST/v1/skills
Daftar Skill
client.skills.list(params?, options?): PageCursor<Skill>
GET/v1/skills
Dapatkan Skill
client.skills.retrieve(skillID, params?, options?): Skill
GET/v1/skills/{skill_id}
Hapus Skill
client.skills.delete(skillID, params?, options?): DeletedSkill
DELETE/v1/skills/{skill_id}
Dapatkan Organisasi Saat Ini
client.organization.retrieve(options?): OrganizationInfo
GET/v1/organizations/me

Ambil informasi tentang organisasi yang terkait dengan kunci API yang diautentikasi.