TokenLab

Files & Batches

Retrieve File Content

Download file content.

GET
/v1/files/{file_id}/content

Download batch input, output, or error files. With Anthropic Files headers, the same API downloads Anthropic-format files in the current Workspace.

Example

Request

cURL
curl -X GET "https://api.tokenlab.sh/v1/files/file_abc123/content" \
  -H "Authorization: Bearer sk-your-api-key" \
  --output batch-output.jsonl

Content Types

Batch files are returned as JSONL or plain text. Image-reference files are returned as binary content.

Response example

Response

200 OK
{"custom_id":"request-1","response":{"status_code":200,"body":{"id":"chatcmpl_abc123"}}}
{"custom_id":"request-2","error":{"code":"invalid_request_error","message":"Invalid model"}}

Important fields

bodybinary|string
File content. Save or parse it according to Content-Type; parse JSONL one line at a time.
custom_idstring
ID that matches a batch input item to its result.

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Path Parameters

file_id*string

Response

text/plain

application/json