> ## 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.

# List Batches

> Returns a list of batches.



## OpenAPI

````yaml GET /batches
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:
    get:
      tags:
        - Batches
      summary: List Batches
      description: Returns a list of batches.
      operationId: listBatches
      parameters:
        - name: limit
          in: query
          description: Maximum number of batches to return.
          schema:
            type: string
        - name: after
          in: query
          description: Cursor for pagination (batch ID to start after).
          schema:
            type: string
      responses:
        '200':
          description: List of batches
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListBatchResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ListBatchResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/BatchResponse'
        first_id:
          type: string
        last_id:
          type: string
        has_more:
          type: boolean
    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
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
    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
    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'
    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.

````