Berkas & batch

Mengambil Konten File

Unduh konten file.

GET
/v1/files/{file_id}/content

Unduh file input, output, atau error batch. Dengan header Anthropic Files, API yang sama mengunduh file berformat Anthropic di Workspace saat ini.

Contoh

Permintaan

cURL
curl -X GET "https://api.tokenlab.sh/v1/files/file_abc123/content" \
  -H "Authorization: Bearer sk-your-api-key" \
  --output batch-output.jsonl

Tipe Konten

File batch dikembalikan sebagai JSONL atau teks biasa. File referensi gambar dikembalikan sebagai konten biner.

Contoh respons

Respons

200 OK
{"custom_id":"request-1","response":{"status_code":200,"body":{"id":"chatcmpl_abc123"}}}
{"custom_id":"request-2","error":{"code":"invalid_request_error","message":"Invalid model"}}

Bidang penting

bodybinary|string
Konten file. Simpan atau urai sesuai dengan Content-Type; urai JSONL satu baris setiap kalinya.
custom_idstring
ID yang mencocokkan item input batch dengan hasilnya.

Otorisasi

BearerAuth
AuthorizationBearer <token>

Autentikasi API Key. Buat atau kelola API key di Dashboard > API > API Keys.

Lokasi: header

Parameter path

file_id*string

Respons

text/plain

application/json