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

# Create batch

> Create a batch from an uploaded JSONL file. See [Batch](https://docs.liquid.ai/api/guides/batch).



## OpenAPI

````yaml /api/openapi.json post /openai/v1/batches
openapi: 3.1.0
info:
  title: Liquid inference API
  version: 1.0.0
  description: >-
    OpenAI-compatible inference API plus native endpoints.


    **Authentication** — Every request needs an API key, sent as a bearer token:
    `Authorization: Bearer $LIQUID_API_KEY`. Create a key on the [API
    keys](https://console.liquid.ai/dashboard/api-keys) page of Liquid Console;
    it is shown once.


    **Batch uploads** — Batch input files are uploaded through a presigned URL
    from `POST /v1/files`; see the [Batch
    guide](https://docs.liquid.ai/api/guides/batch).


    **Decision models** — `POST /decisions/v1/systemone` implements TypeSafe's
    System One API for typed Choice, Score, and Noul decisions from decision
    models such as `d1.1` and `d1-ultra`.
servers:
  - url: https://api.liquid.ai
security:
  - apiKey: []
tags:
  - name: Models
  - name: Chat
  - name: Decision models
  - name: Files
  - name: Batches
  - name: Large uploads
paths:
  /openai/v1/batches:
    post:
      tags:
        - Batches
      summary: Create batch
      description: >-
        Create a batch from an uploaded JSONL file. See
        [Batch](https://docs.liquid.ai/api/guides/batch).
      operationId: create-batch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                input_file_id:
                  type: string
                  description: >-
                    The id of an uploaded file with purpose "batch" (see POST
                    /v1/files).
                endpoint:
                  type: string
                  description: >-
                    The endpoint every line targets: /v1/chat/completions or
                    /v1/completions.
                completion_window:
                  type: string
                  description: Time window for completion. Defaults to "24h".
                metadata:
                  type: object
                  additionalProperties: true
                  description: Arbitrary key-value pairs.
              required:
                - input_file_id
                - endpoint
            example:
              input_file_id: file_abc123
              endpoint: /v1/chat/completions
              completion_window: 24h
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              example:
                id: batch_abc123
                object: batch
                endpoint: /v1/chat/completions
                input_file_id: file_abc123
                completion_window: 24h
                status: validating
                created_at: 1730419200
                expires_at: 1730505600
                request_counts:
                  total: 0
                  completed: 0
                  failed: 0
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The batch id.
                  object:
                    type: string
                    description: Always "batch".
                  endpoint:
                    type: string
                    description: The endpoint each request targets.
                  input_file_id:
                    type: string
                    description: The uploaded input file id.
                  output_file_id:
                    type: string
                    description: Result file id, once completed.
                  error_file_id:
                    type: string
                    description: Error file id, if any requests failed.
                  status:
                    type: string
                    description: >-
                      One of validating, in_progress, finalizing, completed,
                      failed, expired, cancelling, cancelled.
                  completion_window:
                    type: string
                    description: The requested completion window.
                  request_counts:
                    type: object
                    additionalProperties: true
                    description: 'Live counts: { total, completed, failed }.'
                  created_at:
                    type: integer
                    description: Unix timestamp (seconds) of creation.
                  errors:
                    type: object
                    additionalProperties: true
                    description: >-
                      Present when the input failed validation: { object:
                      "list", data: [...] }.
                  metadata:
                    type: object
                    additionalProperties: true
                    description: Any metadata supplied at creation.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl https://api.liquid.ai/openai/v1/batches \
              -H "Authorization: Bearer $LIQUID_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "input_file_id": "file_abc123",
                "endpoint": "/v1/chat/completions",
                "completion_window": "24h"
              }'
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A Liquid API key from the [API
        keys](https://console.liquid.ai/dashboard/api-keys) page of Liquid
        Console, sent as `Authorization: Bearer $LIQUID_API_KEY`.

````

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