Berkas & batch
Mengambil Konten File
Unduh konten file.
Unduh file input, output, atau error batch. Dengan header Anthropic Files, API yang sama mengunduh file berformat Anthropic di Workspace saat ini.
Permintaan
curl -X GET "https://api.tokenlab.sh/v1/files/file_abc123/content" \
-H "Authorization: Bearer sk-your-api-key" \
--output batch-output.jsonlTipe Konten
File batch dikembalikan sebagai JSONL atau teks biasa. File referensi gambar dikembalikan sebagai konten biner.
Respons
{"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