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

# Retrieve Batch

> Get a batch: its status, request counts and, once it has settled, its cost.



## OpenAPI

````yaml https://api.edenai.run/v3/docs/openapi.json get /v3/batches/{batch_id}
openapi: 3.1.0
info:
  title: Eden AI API V3
  version: 3.0.0
servers:
  - url: https://api.edenai.run
    description: Production server
security: []
paths:
  /v3/batches/{batch_id}:
    get:
      tags:
        - Batches
      summary: Retrieve Batch
      description: >-
        Get a batch: its status, request counts and, once it has settled, its
        cost.
      operationId: retrieve_batch_v3_batches__batch_id__get
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            description: 'The batch id: the `id` the create call returned.'
            title: Batch Id
          description: 'The batch id: the `id` the create call returned.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchObject'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - AuthBearer: []
components:
  schemas:
    BatchObject:
      properties:
        id:
          type: string
          title: Id
          description: The batch id.
        object:
          type: string
          const: batch
          title: Object
          description: Always `batch`.
          default: batch
        endpoint:
          type: string
          title: Endpoint
          description: The endpoint every request of the batch calls.
          default: /v1/chat/completions
        model:
          type: string
          title: Model
          description: >-
            The model id every line of the batch named, as written:
            `openai/<model>`, `anthropic/<model>`, `mistral/<model>`,
            `amazon/<model>@eu` or `vertex/<model>@eu`, or an alias of it.
        status:
          type: string
          enum:
            - validating
            - in_progress
            - finalizing
            - completed
            - failed
            - expired
            - cancelling
            - cancelled
          title: Status
          description: Where the batch is in its lifecycle.
        request_counts:
          $ref: '#/components/schemas/BatchRequestCounts'
          description: How many requests have finished, refreshed every few minutes.
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
          description: The key/value pairs given at create.
        created_at:
          type: integer
          title: Created At
          description: When the batch was created, Unix seconds.
        finished_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Finished At
          description: When the batch finished and settled, Unix seconds.
        cost:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Cost
          description: >-
            What the batch billed, in US dollars, once it finished; null before.
            Each request that succeeded bills its tokens at the model's batch
            rates; a failed one, or one that never ran, bills zero. A request
            that succeeded with no token count bills an estimate at the same
            rates: its prompt tokens, the output its response shows and a
            reasoning allowance, the output never above the most the request
            could produce. A request the provider counts as completed with no
            result line bills the same estimate with no output shown. When the
            results cannot be read, every request that may have run bills that
            estimate.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Why the batch failed, when it did.
        results_available:
          type: boolean
          title: Results Available
          description: >-
            Whether `GET /v3/batches/{batch_id}/results` is sure to serve this
            batch, read from the stored batch with no call to the provider: it
            has finished, was created at the provider, its recorded provider
            status is ended, and it was created less than 30 days ago, less one
            hour (29 days on Anthropic, which keeps results for 29 days:
            `jobs.results_promised_until`); past it this reads false, and the
            results route still tries and answers 410 once the results are gone.
            False while the batch runs, and for a batch that ended before the
            provider accepted it. A batch settled past its deadline before the
            provider ended it reads false, and the results route checks the
            provider live and can still serve it.
          default: false
      type: object
      required:
        - id
        - model
        - status
        - created_at
      title: BatchObject
      description: A chat batch.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BatchRequestCounts:
      properties:
        total:
          type: integer
          title: Total
          description: Requests in the batch.
          default: 0
        completed:
          type: integer
          title: Completed
          description: Requests that succeeded.
          default: 0
        failed:
          type: integer
          title: Failed
          description: Requests that failed.
          default: 0
      type: object
      title: BatchRequestCounts
      description: >-
        How many of the batch's requests have finished, as the provider last
        reported them.
    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
  securitySchemes:
    AuthBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.