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

# Create batch

> Upload files



## OpenAPI

````yaml post /batches
openapi: 3.0.0
info:
  title: SiliconFlow API
  description: The SiliconFlow REST API
  version: 1.0.0
  contact:
    name: SiliconFlow Support
    url: https://www.siliconflow.com/
  license:
    name: MIT
    url: https://github.com/siliconflow-inc/siliconflow-api/blob/main/LICENSE
servers:
  - url: https://api.siliconflow.com/v1
security:
  - bearerAuth: []
paths:
  /batches:
    post:
      summary: Upload Files
      description: Upload files
      operationId: UploadFiles
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                input_file_id:
                  type: string
                  example: file-jkvytbjtow
                  description: >-
                    The ID of an uploaded file that contains requests for the
                    new batch.
                endpoint:
                  type: string
                  example: /v1/chat/completions
                  description: >-
                    The endpoint to be used for all requests in the batch.
                    Currently /v1/chat/completions is supported.
                completion_window:
                  type: string
                  example: 24h
                  description: >-
                    The time frame within which the batch should be processed.
                    The maximum value is 24 hours, and  the minimum value is 336
                    hours.
                metadata:
                  type: object
                  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.<\br>Keys are strings with a
                    maximum length of 64 characters. Values are strings with a
                    maximum length of 512 characters.
                  properties:
                    description:
                      type: string
                      example: nightly eval job
                replace:
                  type: object
                  properties:
                    model:
                      type: string
                      example: deepseek-ai/DeepSeek-V3
                      enum:
                        - deepseek-ai/DeepSeek-V3
                        - deepseek-ai/DeepSeek-R1
              required:
                - input_file_id
                - completion_window
                - endpoint
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: batch_rdyqgrcgjg
                  object:
                    type: string
                    example: batch
                  endpoint:
                    type: string
                    example: /v1/chat/completions
                  errors:
                    type: array
                    items:
                      type: string
                    example: null
                  input_file_id:
                    type: string
                    example: file-jkvytbjtow
                  completion_window:
                    type: string
                    example: 24h
                  status:
                    type: string
                    example: in_queue
                  output_file_id:
                    type: string
                    example: null
                  error_file_id:
                    type: string
                    example: null
                  created_at:
                    type: integer
                    example: 1741685413
                  in_progress_at:
                    type: integer
                    example: null
                  expires_at:
                    type: integer
                    example: 1741771813
                  finalizing_at:
                    type: integer
                    example: null
                  completed_at:
                    type: integer
                    example: null
                  failed_at:
                    type: integer
                    example: null
                  expired_at:
                    type: integer
                    example: null
                  cancelling_at:
                    type: integer
                    example: null
                  cancelled_at:
                    type: integer
                    example: null
                  request_counts:
                    type: object
                    example: null
                  metadata:
                    type: object
                    properties:
                      description:
                        type: string
                        example: nightly eval job
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRquestData'
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedData'
        '404':
          description: NotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundData'
        '503':
          description: Overloaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringData'
        '504':
          description: Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeoutData'
      deprecated: false
components:
  schemas:
    BadRquestData:
      type: object
      required:
        - message
        - data
        - code
      properties:
        code:
          type: integer
          nullable: true
          default: false
          example: 20012
        message:
          type: string
          nullable: false
        data:
          type: string
          nullable: false
    UnauthorizedData:
      type: string
      default: false
      example: Invalid token
    NotFoundData:
      type: string
      default: false
      example: 404 page not found
    StringData:
      type: string
    TimeoutData:
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: your api key
      description: >-
        Use the following format for authentication: Bearer [<your api
        key>](https://cloud.siliconflow.com/account/ak)

````