Skip to navigation

Download a batch file

Download the JSONL content of an input, output, or error file. Files are kept for 7 days; an input file from its upload, and output and error files from when the batch finishes. A file past its expires_at returns 404 with the code file_expired.

A batch’s output file has one line for each request that succeeded, and its error file one line for each request that did not. Each line is {"id", "custom_id", "response", "error"}:

  • A request that got an HTTP answer has response with its status_code, its request_id (the ID its row in Account Usage carries), and the body the endpoint returned, and error is null. A failed request’s body is an error body in the {"error": {"message", "type", "param", "code"}} shape.
  • A request that never ran has response: null and error with a code and message, for example batch_expired when the batch expired first or batch_cancelled when the batch was cancelled.

Authentication

AuthorizationBearer

Pass your EmpirioLabs API key as a bearer token. The Anthropic-style x-api-key header is also accepted on every endpoint.

Path parameters

file_idstringRequired
Id of a batch input, output or error file.

Response

JSONL file content.

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error