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

# Retrieve File

> Retrieves metadata for a single uploaded file.

## Overview

This endpoint primarily serves TokenLab's OpenAI-compatible Batch API file objects.

When the request opts into Anthropic Files compatibility mode, the same route can also return Anthropic-style file metadata for the bound workspace.

Without Anthropic headers, this route can return either a batch file object or a TokenLab image/reference file object.

## Notes

* Batch input files must use `purpose=batch`.
* `completion_window` is currently `24h`.
* Output ordering is not guaranteed; always match by `custom_id`.
* Streaming is not supported inside batch items.

## Example

<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 / Response

Use the interactive OpenAPI panel above for the exact schema.

## Operational Tips

* Use `custom_id` for idempotent downstream reconciliation.
* Expect `output_file_id` and `error_file_id` only after the worker finalizes the batch.
* Batch pricing may differ from synchronous pricing because `isBatchRequest=true` discount rules apply.

## Response example

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "file_abc123",
    "object": "file",
    "bytes": 32768,
    "created_at": 1706000000,
    "filename": "batch-input.jsonl",
    "purpose": "batch"
  }
  ```
</ResponseExample>

## Important fields

<ResponseField name="id" type="string">File identifier used by related APIs.</ResponseField>
<ResponseField name="filename" type="string">Original or generated file name.</ResponseField>
<ResponseField name="purpose" type="string">File purpose used by the owning workflow, such as `batch`, `batch_output`, `user_data`, or `vision`.</ResponseField>
