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

# Get Batch

> Retrieve a specific batch.



## OpenAPI

````yaml /openai-api-swagger.json get /v1/batches/{batch_id}
openapi: 3.1.0
info:
  title: impala.ai OpenAI API v0.1.0
  description: >-
    An OpenAI API compatible server for impala.ai


    All timestamps are Unix epoch seconds, UTC. A null `*_at` field means the
    event did not occur for this run.


    All costs in USD.
  version: 0.1.0
servers: []
security: []
paths:
  /v1/batches/{batch_id}:
    get:
      tags:
        - batches
      summary: Get Batch
      description: Retrieve a specific batch.
      operationId: get_batch_v1_batches__batch_id__get
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            title: Batch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchModel'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BatchModel:
      properties:
        cancelled_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cancelled At
          description: The Unix timestamp (in seconds) for when the batch was cancelled.
        cancelling_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cancelling At
          description: >-
            The Unix timestamp (in seconds) for when the batch started
            cancelling.
        completed_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completed At
          description: The Unix timestamp (in seconds) for when the batch was completed.
        completion_window:
          type: string
          title: Completion Window
          description: The time frame within which the batch should be processed.
        created_at:
          type: integer
          title: Created At
          description: The Unix timestamp (in seconds) for when the batch was created.
        endpoint:
          type: string
          title: Endpoint
          description: The OpenAI API endpoint used by the batch.
        error_file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Error File Id
          description: The ID of the file containing the outputs of requests with errors.
        errors:
          anyOf:
            - $ref: '#/components/schemas/BatchErrorsModel'
            - type: 'null'
          description: The errors encountered during batch processing.
        expired_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expired At
          description: The Unix timestamp (in seconds) for when the batch expired.
        expires_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expires At
          description: The Unix timestamp (in seconds) for when the batch will expire.
        failed_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Failed At
          description: The Unix timestamp (in seconds) for when the batch failed.
        finalizing_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Finalizing At
          description: >-
            The Unix timestamp (in seconds) for when the batch started
            finalizing.
        id:
          type: string
          title: Id
          description: The unique identifier for the batch.
        job_id:
          type: string
          title: Job Id
          description: ID of the Job definition this batch belongs to.
        in_progress_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: In Progress At
          description: >-
            The Unix timestamp (in seconds) for when the batch started
            processing.
        input_file_id:
          type: string
          title: Input File Id
          description: The ID of the input file for the batch.
        metadata:
          additionalProperties:
            type: string
          type: object
          title: Metadata
          description: >-
            Set of 16 key-value pairs that can be attached to an object. This
            can be useful for storing additional information about the object in
            a structured format, and querying for objects via API or the
            dashboard. Keys are strings with a maximum length of 64 characters.
            Values are strings with a maximum length of 512 characters.
        model:
          type: string
          title: Model
          description: The model used for this batch run.
          default: ''
        object:
          type: string
          const: batch
          title: Object
          description: The object type, which is always `batch`.
          default: batch
        output_file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Output File Id
          description: >-
            The ID of the file containing the outputs of successfully executed
            requests.
        price_1m_tokens:
          type: number
          title: Price 1M Tokens
          description: Effective price in USD per 1,000,000 tokens.
          default: 0
        request_counts:
          $ref: '#/components/schemas/RequestCountsModel'
          description: The request counts for different statuses within the batch.
        status:
          $ref: '#/components/schemas/BatchStatus'
          description: The current status of the batch.
        processing_cost:
          type: number
          title: Processing Cost
          description: Total processing cost in USD.
          default: 0
        usage:
          $ref: '#/components/schemas/CompletionUsageModel'
          description: Usage statistics for the completion request.
      type: object
      required:
        - completion_window
        - created_at
        - endpoint
        - id
        - job_id
        - input_file_id
        - request_counts
        - status
      title: BatchModel
    ErrorResponseModel:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: The error details.
      type: object
      required:
        - error
      title: ErrorResponseModel
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BatchErrorsModel:
      properties:
        data:
          items:
            $ref: '#/components/schemas/BatchErrorModel'
          type: array
          title: Data
          description: A list of errors encountered during batch processing.
        object:
          type: string
          const: list
          title: Object
          description: The object type, which is always `list`.
          default: list
      type: object
      required:
        - data
      title: BatchErrorsModel
    RequestCountsModel:
      properties:
        completed:
          type: integer
          title: Completed
          description: Number of requests that have been completed successfully.
        failed:
          type: integer
          title: Failed
          description: Number of requests that have failed.
        total:
          type: integer
          title: Total
          description: Total number of requests in the batch.
      type: object
      required:
        - completed
        - failed
        - total
      title: RequestCountsModel
    BatchStatus:
      type: string
      enum:
        - validating
        - failed
        - in_progress
        - finalizing
        - completed
        - expired
        - cancelling
        - cancelled
      title: BatchStatus
    CompletionUsageModel:
      properties:
        prompt_tokens:
          type: number
          title: Prompt Tokens
          description: Number of tokens in the prompt (total input tokens processed).
          default: 0
        completion_tokens:
          type: number
          title: Completion Tokens
          description: Number of tokens in the generated completion.
          default: 0
        total_tokens:
          type: number
          title: Total Tokens
          description: Total number of tokens used in the request (prompt + completion).
          default: 0
      type: object
      title: CompletionUsageModel
      description: Token usage for the batch run (OpenAI / litellm convention).
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: A human-readable error message.
        type:
          type: string
          title: Type
          description: The type of error.
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: The parameter that caused the error, if applicable.
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: An error code, if applicable.
      type: object
      required:
        - message
        - type
      title: ErrorDetail
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    BatchErrorModel:
      properties:
        code:
          type: string
          title: Code
          description: An error code identifying the error type.
        line:
          anyOf:
            - type: integer
            - type: 'null'
          title: Line
          description: >-
            The line number of the input file where the error occurred, if
            applicable.
        message:
          type: string
          title: Message
          description: A human-readable message providing more details about the error.
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: The name of the parameter that caused the error, if applicable.
      type: object
      required:
        - code
        - line
        - message
        - param
      title: BatchErrorModel

````