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

# Retrieve Batch

> Retrieves a batch by its ID.



## OpenAPI

````yaml GET /batches/{id}
openapi: 3.0.3
info:
  title: Traceport Gateway API
  description: |
    OpenAI-compatible unified gateway API for Traceport.
    Supports multiple LLM providers (OpenAI, Anthropic, Google, Bedrock) through
    a single set of endpoints. All endpoints require API key authentication via
    the `Authorization: Bearer <api-key>` header.
  version: 1.0.0
  contact:
    name: Traceport
    url: https://traceport.ai
servers:
  - url: /v1
    description: API v1
security:
  - BearerAuth: []
tags:
  - name: Chat Completions
    description: Create chat completions (supports streaming)
  - name: Embeddings
    description: Create text embeddings
  - name: Batches
    description: Manage batch processing jobs
  - name: Files
    description: Upload and manage files for batch processing
  - name: Workflow
    description: Execute server-side workflows
  - name: Prompts
    description: Run published prompt templates
  - name: Realtime
    description: Build interactive, low-latency AI applications with persistent connections
paths:
  /batches/{id}:
    get:
      tags:
        - Batches
      summary: Retrieve Batch
      description: Retrieves a batch by its ID.
      operationId: getBatch
      parameters:
        - $ref: '#/components/parameters/BatchId'
      responses:
        '200':
          description: Batch object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    BatchId:
      name: id
      in: path
      required: true
      description: Batch ID.
      schema:
        type: string
  schemas:
    BatchResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: batch
        endpoint:
          type: string
        errors:
          $ref: '#/components/schemas/BatchErrors'
        input_file_id:
          type: string
        completion_window:
          type: string
        status:
          type: string
          enum:
            - validating
            - in_progress
            - completed
            - failed
            - expired
            - cancelling
            - cancelled
        output_file_id:
          type: string
        error_file_id:
          type: string
        created_at:
          type: integer
          format: int64
        in_progress_at:
          type: integer
          format: int64
          nullable: true
        expires_at:
          type: integer
          format: int64
          nullable: true
        finalizing_at:
          type: integer
          format: int64
          nullable: true
        completed_at:
          type: integer
          format: int64
          nullable: true
        failed_at:
          type: integer
          format: int64
          nullable: true
        expired_at:
          type: integer
          format: int64
          nullable: true
        cancelling_at:
          type: integer
          format: int64
          nullable: true
        cancelled_at:
          type: integer
          format: int64
          nullable: true
        request_counts:
          $ref: '#/components/schemas/BatchCounts'
        metadata:
          type: object
          additionalProperties:
            type: string
    BatchErrors:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/BatchError'
    BatchCounts:
      type: object
      properties:
        total:
          type: integer
        completed:
          type: integer
        failed:
          type: integer
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
    BatchError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        param:
          type: string
        line:
          type: integer
          nullable: true
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key passed as a Bearer token.

````