Skip to main content
The Batch and Files APIs share one data model. You upload an input file, create a batch that points at it, and when the batch finishes the service writes result and error files back. This page describes those two objects, the lifecycle a batch moves through, and where each endpoint lives. For request and response details, every endpoint has an interactive page under API Reference, linked from the tables below. To run a batch end to end, start with the Quickstart.

Authentication

Both APIs authenticate with headers, not a bearer token:
Missing either header returns 401; a key that is invalid, inactive, or does not belong to the supplied project returns 403; an organization with no balance and no free credits returns 429 with insufficient_quota. See the Errors reference for the complete list.

Endpoints

The Files API stores the JSONL that drives a batch: The Batches API submits and monitors the jobs: Both APIs are wire-compatible with OpenAI’s /v1/files and /v1/batches, so the official SDKs work once pointed at the ZeroGPU base URL. The ZeroGPU specifics are: completion_window must be "24h", endpoint must be /v1/chat/completions (the only batchable endpoint), files are soft-deleted, and error files carry an is_error flag (below).

The File object

Returned by upload and retrieve, and inside data[] on list.
Output and error files are both written with purpose: "batch_output"; the is_error: true flag is what distinguishes the error file when you GET /v1/files?purpose=batch_output.

The Batch object

Returned by create, retrieve, and cancel, and inside data[] on list.

Status lifecycle

Validation is synchronous, processing is asynchronous: the create call returns only after the JSONL passes (or fails) validation, and lines are then worked through an internal queue. Once a batch is terminal, no further state changes occur, so stop polling. Retrieve returns live request_counts; the list endpoint may lag by a few seconds, so poll a specific batch for accurate progress.

Reading results

When status is completed:
  • output_file_id is set if any line returned 2xx. Download it and match results to inputs by custom_id, order is not preserved.
  • error_file_id is set if any line failed. Partition by error.code to decide what to retry.
Both files follow the same 30-day retention as your uploads, and the line schemas live in JSONL format. Deleting an input file does not stop a running batch, the input is read at creation time. For size and rate limits, see the Overview quick facts.

Next steps

JSONL format →

Exact line schema for input, output, and error files.

Errors reference →

Every status, validation message, and error-file code, with recovery steps.