Files & Batches
List Files
List uploaded batch and image-reference files.
List batch and image-reference files. Filter with purpose=batch, purpose=batch_output, purpose=user_data, or purpose=vision.
With Anthropic Files headers, the same API lists Anthropic-format files in the current Workspace.
Request
curl -X GET "https://api.tokenlab.sh/v1/files?purpose=batch&limit=20" \
-H "Authorization: Bearer sk-your-api-key"Filters
- For batch and image-reference files,
limitis 1–10000 (default 10000), withafterfor pagination. In Anthropic Files mode,limitis 1–1000 (default 20); use eitherafter_idorbefore_id, not both. purposecan bebatch,batch_output,user_data, orvision.user_dataandvisionreturn TokenLab-created image reference files when available.
Response
{
"object": "list",
"data": [{ "id": "file_abc123", "object": "file", "purpose": "batch" }],
"first_id": "file_abc123",
"last_id": "file_abc123",
"has_more": false
}Important fields
list.has_more is true.Authorization
BearerAuth API Key authentication. Create or manage API keys in Dashboard > API > API Keys.
In: header
Query Parameters
1 <= value <= 100020Anthropic Files cursor. Return files after this public file id. Requires the Anthropic Files beta header and cannot be combined with before_id.
Anthropic Files cursor. Return files before this public file id. Requires the Anthropic Files beta header and cannot be combined with after_id.
Reserved Anthropic Files scope cursor. TokenLab currently returns an explicit unsupported error rather than silently ignoring this value.
Optional file purpose filter. batch and batch_output cover Batch API files; user_data and vision cover TokenLab image/reference file bindings. Anthropic Files API mode is selected by Anthropic headers rather than this query parameter.
Value in
- "batch"
- "batch_output"
- "user_data"
- "vision"
Headers
Include files-api-2025-04-14 to use Anthropic Files API mode.
Response
application/json
application/json