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

> Downloads the original content for an uploaded file.

## Overview

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

When the request opts into Anthropic Files compatibility mode, the same route can proxy the original stored file content for the bound workspace.

Without Anthropic headers, this route downloads batch file content or proxies content for a bound image/reference file when the provider supports file content retrieval.

## 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/content" \
    -H "Authorization: Bearer sk-your-api-key" \
    --output batch-output.jsonl
  ```
</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>
  ```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>

## Important fields

<ResponseField name="body" type="binary|string">Raw response body. Save it directly instead of parsing it as JSON.</ResponseField>
<ResponseField name="custom_id" type="string">Identifier used for follow-up calls and support.</ResponseField>
