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

# List batches

> Lists your organization's batches, newest first.



## OpenAPI

````yaml get /v1/batches
openapi: 3.1.0
info:
  title: Perplexity AI API
  description: Perplexity AI API
  version: 1.0.0
servers:
  - url: https://api.perplexity.ai
    description: Perplexity AI API
security: []
paths:
  /v1/batches:
    get:
      tags:
        - Batches
      summary: List batches
      description: Lists your organization's batches, newest first.
      operationId: listBatches
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: Maximum number of batches to return
        - name: after
          in: query
          required: false
          schema:
            type: string
          description: Batch id to start after, the `last_id` of the previous page
      responses:
        '200':
          description: A page of batches
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchList'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BatchList:
      type: object
      required:
        - object
        - data
        - has_more
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Batch'
        first_id:
          type: string
          nullable: true
        last_id:
          type: string
          nullable: true
        has_more:
          type: boolean
    ApiError:
      type: object
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              description: Human-readable error message
              type: string
            type:
              type: string
              description: Error type identifier
            code:
              type: integer
              description: HTTP status code
            param:
              type: string
              description: Parameter that caused the error
              nullable: true
    Batch:
      type: object
      required:
        - id
        - object
        - endpoint
        - input_file_id
        - completion_window
        - status
        - created_at
        - request_counts
        - usage
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - batch
        endpoint:
          type: string
        errors:
          allOf:
            - $ref: '#/components/schemas/BatchErrors'
          nullable: true
        input_file_id:
          type: string
        completion_window:
          type: string
        status:
          $ref: '#/components/schemas/BatchStatus'
        output_file_id:
          type: string
          nullable: true
        error_file_id:
          type: string
          nullable: true
        created_at:
          type: integer
          format: int64
          description: Unix seconds
        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/BatchRequestCounts'
        usage:
          $ref: '#/components/schemas/BatchUsage'
        metadata:
          type: object
          nullable: true
          additionalProperties:
            type: string
    BatchErrors:
      type: object
      required:
        - object
        - data
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/BatchError'
    BatchStatus:
      type: string
      enum:
        - validating
        - in_progress
        - finalizing
        - completed
        - expired
        - cancelling
        - cancelled
        - failed
    BatchRequestCounts:
      type: object
      required:
        - total
        - completed
        - failed
      properties:
        total:
          format: int64
          type: integer
        completed:
          format: int64
          type: integer
        failed:
          format: int64
          type: integer
    BatchUsage:
      type: object
      required:
        - input_tokens
        - input_tokens_details
        - output_tokens
        - output_tokens_details
        - total_tokens
      properties:
        input_tokens:
          format: int64
          type: integer
        input_tokens_details:
          type: object
          required:
            - cached_tokens
          properties:
            cached_tokens:
              format: int64
              type: integer
        output_tokens:
          format: int64
          type: integer
        output_tokens_details:
          type: object
          required:
            - reasoning_tokens
          properties:
            reasoning_tokens:
              format: int64
              type: integer
        total_tokens:
          format: int64
          type: integer
    BatchError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        line:
          type: integer
          format: int64
          nullable: true
          description: 1-based input line the error refers to
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````