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

# Daftar File

> Daftar file yang diunggah untuk workflow batch dan mode kompatibilitas berbasis file yang didukung.

## Ikhtisar

Endpoint ini terutama melayani Batch API TokenLab yang kompatibel dengan OpenAI, termasuk input batch yang diunggah dan file output atau error yang dihasilkan.

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

Tanpa header Anthropic, daftar dapat berisi file batch dan file gambar/referensi TokenLab. Gunakan `purpose=batch`, `purpose=batch_output`, `purpose=user_data`, atau `purpose=vision` untuk mempersempit daftar.

## Catatan

* File input batch harus menggunakan `purpose=batch`.
* Gunakan `purpose=batch_output` untuk fokus pada file output yang dihasilkan.
* `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?purpose=batch&limit=20" \
    -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}
  {
    "object": "list",
    "data": [{ "id": "file_abc123", "object": "file", "purpose": "batch" }]
  }
  ```
</ResponseExample>

## Field penting

<ResponseField name="object" type="string">Tipe object respons.</ResponseField>
<ResponseField name="data" type="array">Daftar atau payload yang dikembalikan respons ini.</ResponseField>
