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

# Create a native provider batch

> GoModel API reference for POST /v1/batches: Create a native provider batch.



## OpenAPI

````yaml /openapi.json post /v1/batches
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, Fireworks AI, Meta, OpenRouter, Kilo AI, DeepSeek, Z.ai, xAI,
    MiniMax, Xiaomi MiMo, Mistral AI, OpenCode Go, Oracle, Ollama, Bailian).
    Drop-in OpenAI-compatible API.
  title: GoModel API
  contact: {}
  version: '1.0'
servers:
  - url: '{base_url}'
    description: Edit the base URL to point at your GoModel deployment.
    variables:
      base_url:
        default: http://localhost:8080
        description: Your GoModel deployment URL
security: []
paths:
  /v1/batches:
    post:
      tags:
        - batch
      summary: Create a native provider batch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/core.BatchRequest'
        description: Batch request
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.BatchResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
      security:
        - BearerAuth: []
components:
  schemas:
    core.BatchRequest:
      type: object
      properties:
        completion_window:
          type: string
        endpoint:
          type: string
        input_file_id:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        requests:
          type: array
          items:
            $ref: '#/components/schemas/core.BatchRequestItem'
    core.BatchResponse:
      type: object
      properties:
        cancelled_at:
          type: integer
        cancelling_at:
          type: integer
        completed_at:
          type: integer
        completion_window:
          type: string
        created_at:
          type: integer
        endpoint:
          type: string
        failed_at:
          type: integer
        id:
          type: string
        in_progress_at:
          type: integer
        input_file_id:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        object:
          type: string
        provider:
          type: string
        provider_batch_id:
          type: string
        request_counts:
          $ref: '#/components/schemas/core.BatchRequestCounts'
        results:
          type: array
          items:
            $ref: '#/components/schemas/core.BatchResultItem'
        status:
          type: string
        usage:
          description: >-
            Gateway extension: optional usage/result snapshots persisted by the
            gateway.
          allOf:
            - $ref: '#/components/schemas/core.BatchUsageSummary'
    core.OpenAIErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/core.OpenAIErrorObject'
    core.BatchRequestItem:
      type: object
      properties:
        body:
          type: object
        custom_id:
          type: string
        method:
          type: string
        url:
          type: string
    core.BatchRequestCounts:
      type: object
      properties:
        completed:
          type: integer
        failed:
          type: integer
        total:
          type: integer
    core.BatchResultItem:
      type: object
      properties:
        custom_id:
          type: string
        error:
          $ref: '#/components/schemas/core.BatchError'
        index:
          type: integer
        model:
          type: string
        provider:
          type: string
        response: {}
        status_code:
          type: integer
        url:
          type: string
    core.BatchUsageSummary:
      type: object
      properties:
        input_cost:
          type: number
        input_tokens:
          type: integer
        output_cost:
          type: number
        output_tokens:
          type: integer
        total_cost:
          type: number
        total_tokens:
          type: integer
    core.OpenAIErrorObject:
      type: object
      required:
        - code
        - message
        - param
        - type
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
        param:
          type: string
          nullable: true
        provider:
          description: |-
            Provider names the upstream provider that produced the error. It is
            omitted for errors raised by the gateway itself.
          type: string
        type:
          $ref: '#/components/schemas/core.ErrorType'
    core.BatchError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
    core.ErrorType:
      type: string
      enum:
        - provider_error
        - rate_limit_error
        - invalid_request_error
        - authentication_error
        - not_found_error
        - permission_error
        - internal_error
      x-enum-varnames:
        - ErrorTypeProvider
        - ErrorTypeRateLimit
        - ErrorTypeInvalidRequest
        - ErrorTypeAuthentication
        - ErrorTypeNotFound
        - ErrorTypePermission
        - ErrorTypeInternal
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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