> ## 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 File

> Ambil metadata untuk satu file yang diunggah.

## Ikhtisar

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

Ketika request memakai mode kompatibilitas Anthropic Files, route yang sama juga dapat mengembalikan metadata file bergaya Anthropic untuk workspace yang terikat.

Tanpa header Anthropic, route ini dapat mengembalikan object file batch atau object file gambar/referensi TokenLab.

## 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" \
    -H "Authorization: Bearer sk-your-api-key"
  ```
</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>
  ```json 200 OK theme={null}
  {
    "id": "file_abc123",
    "object": "file",
    "bytes": 32768,
    "created_at": 1706000000,
    "filename": "batch-input.jsonl",
    "purpose": "batch"
  }
  ```
</ResponseExample>

## Field penting

<ResponseField name="id" type="string">Identifier file yang dipakai API terkait.</ResponseField>
<ResponseField name="filename" type="string">Nama file asli atau yang dihasilkan.</ResponseField>
<ResponseField name="purpose" type="string">Purpose file yang digunakan workflow pemilik, seperti `batch`, `batch_output`, `user_data`, atau `vision`.</ResponseField>
