> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerogpu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve batch

> Interactive playground for GET /v1/batches/{batch_id}.

Poll a batch by ID. Use this while `status` is `in_progress` or `cancelling`; stop when the status is terminal (`completed`, `failed`, `expired`, or `cancelled`).

When complete, download results with `output_file_id` and `error_file_id` via [Files API](/docs/batch/objects).


## OpenAPI

````yaml api-reference/openapi/batch.openapi.json GET /v1/batches/{batch_id}
openapi: 3.1.0
info:
  title: ZeroGPU Batch & Files API
  version: '1.0'
  description: >-
    JSONL file storage (`/v1/files`) and asynchronous batch inference
    (`/v1/batches`). Wire-compatible with OpenAI's files and batch APIs. Auth:
    `x-api-key` on every request; `x-project-id` is optional.
servers:
  - url: https://api.zerogpu.ai
    description: Production
security:
  - ApiKey: []
paths:
  /v1/batches/{batch_id}:
    get:
      tags:
        - Batches
      summary: Retrieve a batch
      description: Poll batch status and live `request_counts` while in progress.
      operationId: retrieveBatch
      parameters:
        - name: x-project-id
          in: header
          required: false
          schema:
            type: string
          description: >-
            Optional project identifier. Scopes the request to a specific
            project when provided.
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
          example: batch_01HZX...
      responses:
        '200':
          description: Batch object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Batch'
        '404':
          description: Batch not found
components:
  schemas:
    Batch:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - batch
        endpoint:
          type: string
        status:
          type: string
          enum:
            - validating
            - in_progress
            - finalizing
            - completed
            - failed
            - expired
            - cancelling
            - cancelled
        input_file_id:
          type: string
        output_file_id:
          type: string
          nullable: true
        error_file_id:
          type: string
          nullable: true
        completion_window:
          type: string
        created_at:
          type: integer
        expires_at:
          type: integer
        request_counts:
          type: object
          properties:
            total:
              type: integer
            completed:
              type: integer
            failed:
              type: integer
        metadata:
          type: object
          additionalProperties: true
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key

````