Download batch file content

GET/v1/files/{file_id}/content

Download the raw bytes of a batch output or error JSONL file (or the original input file if you still have access). Use the output_file_id or error_file_id from a completed batch.

Returns Content-Type: application/jsonl (or the stored MIME type) with the file body in the response.

Authentication

Authorization Bearer

Path Parameters

file_idstringrequired

File ID from the batch object or upload response.

Response

Binary JSONL stream. Parse line-by-line; each line is a JSON object.

For output files, lines typically include:

  • custom_id — matches your input line.
  • response — chat completion result or error for that line.
  • error — present when the line failed.

Token360 rewrites response.body.model to your Token360 model name when applicable.

Related: Retrieve batch to obtain output_file_id / error_file_id.

custom_idstring

Your input custom_id.

responseobject

Successful line response. Includes status_code, request_id, and body.

response.status_codeinteger

HTTP status code for this JSONL output line.

response.request_idstring

Request ID for this JSONL output line.

response.bodyobject

Response body for the completed request.

errorobject

Line-level error when the request failed.

error.messagestring

Human-readable error message.

error.codestring

Machine-readable error code.

error.typestring

Error category when returned.

error.stagestring

Processing stage where the error occurred.

error.upstream_http_statusinteger

Provider HTTP status when the error came from upstream.

error.upstream_messagestring

Provider error message when available.

Request

1curl https://api.token360.ai/v1/files/file_output_xyz/content \
2  -H "Authorization: Bearer sk-your-api-key" \
3  -o batch_output.jsonl

Response

jsonl
1{"custom_id":"req-1","response":{"status_code":200,"request_id":"req_abc","body":{"id":"chatcmpl_abc","object":"chat.completion","model":"gpt-4o-mini","choices":[{"index":0,"message":{"role":"assistant","content":"Hi!"},"finish_reason":"stop"}],"usage":{"prompt_tokens":12,"completion_tokens":3,"total_tokens":15}}},"error":null}
Was this page helpful?