> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Ambil Isi File

> Unduh konten asli dari file yang diunggah.

## Ikhtisar

Endpoint ini terutama melayani pengambilan konten file Batch API TokenLab yang kompatibel dengan OpenAI.

Ketika request memakai mode kompatibilitas Anthropic Files, route yang sama juga dapat memproksi konten file asli yang tersimpan untuk workspace yang terikat.

Tanpa header Anthropic, route ini mengunduh konten file batch atau mem-proxy konten file gambar/referensi yang terikat jika provider mendukung pengambilan konten file.

## Catatan

* File input batch harus menggunakan `purpose=batch`.
* `completion_window` saat ini adalah `24h`.
* Urutan output tidak dijamin; selalu cocokkan berdasarkan `custom_id`.
* Streaming tidak didukung di dalam item batch.

## Contoh

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.tokenlab.sh/v1/files/file_abc123/content" \
    -H "Authorization: Bearer sk-your-api-key" \
    --output batch-output.jsonl
  ```
</RequestExample>

## Request / Respons

Gunakan panel OpenAPI interaktif di atas untuk skema yang tepat.

## Tips Operasional

* Gunakan `custom_id` untuk rekonsiliasi downstream yang idempotent.
* Harapkan `output_file_id` dan `error_file_id` hanya setelah worker menyelesaikan batch.
* Harga batch bisa berbeda dari harga sinkron karena aturan diskon `isBatchRequest=true` diterapkan.

## Contoh respons

<ResponseExample>
  ```jsonl 200 OK theme={null}
  {"custom_id":"request-1","response":{"status_code":200,"body":{"id":"chatcmpl_abc123"}}}
  {"custom_id":"request-2","error":{"code":"invalid_request_error","message":"Invalid model"}}
  ```
</ResponseExample>

## Field penting

<ResponseField name="body" type="binary|string">Body respons mentah. Simpan langsung, jangan parse sebagai JSON.</ResponseField>
<ResponseField name="custom_id" type="string">Identifier untuk panggilan lanjutan dan support.</ResponseField>
