TokenLab

Files & Batches

Retrieve File

Retrieves metadata for a single uploaded file.

GET
/v1/files/{file_id}

Return a file's name, size, purpose, and creation time. Without Anthropic headers, this covers batch and image-reference files. With Anthropic Files headers, it covers Anthropic-format files.

Example

Request

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

Image Reference Files

This endpoint can also return metadata for TokenLab-created image reference files. The status field is optional and may be absent for file families that do not provide one.

Response example

Response

200 OK
{
  "id": "file_abc123",
  "object": "file",
  "bytes": 32768,
  "created_at": 1706000000,
  "filename": "batch-input.jsonl",
  "purpose": "batch"
}

Important fields

idstring
File ID.
filenamestring
Original or generated file name.
purposestring
File purpose, such as batch, batch_output, user_data, or vision.

Authorization

BearerAuth
AuthorizationBearer <token>

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

In: header

Path Parameters

file_id*string

Headers

anthropic-beta?string

Include files-api-2025-04-14 to use Anthropic Files API mode.

Response

application/json

application/json