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

# Upload a file

> Upload a JSONL request file for batch processing.



## OpenAPI

````yaml POST /files
openapi: 3.1.0
info:
  title: Valar API
  version: '2026-08-14'
  description: >-
    Valar exposes Responses and Chat Completions endpoints that match the OpenAI
    shape. This reference documents the fields Valar supports today.
servers:
  - url: https://api.valarhq.ai/v1
security:
  - BearerAuth: []
tags:
  - name: Models API
    description: Discover which models you can call.
  - name: Responses API
    description: Responses endpoints that follow the OpenAI interface.
  - name: Chat Completions API
    description: Chat Completions endpoints that follow the OpenAI interface.
  - name: Batches API
    description: Submit request batches and track their progress.
paths:
  /files:
    post:
      tags:
        - Files API
      summary: Upload a file
      description: >-
        Upload a file as `multipart/form-data`. For the Batch API, upload your
        JSONL request file with `purpose: batch`, then pass the returned file ID
        to [Create a batch](/api-reference/batches-api/create-a-batch). Batch
        input files can be up to 500 MB.
      operationId: uploadFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - purpose
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to upload.
                purpose:
                  type: string
                  description: What the file is for. Use `batch` for Batch API input files.
      responses:
        '200':
          description: The uploaded file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileObject'
              example:
                id: file-abc123
                object: file
                bytes: 34333913
                created_at: 1741564800
                filename: requests.jsonl
                purpose: batch
                status: uploaded
                status_details: null
        '400':
          description: The request was malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: We could not authenticate the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Something went wrong on Valar's side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    FileObject:
      type: object
      required:
        - id
        - object
        - bytes
        - created_at
        - filename
        - purpose
      properties:
        id:
          type: string
          description: The file's unique ID.
        object:
          type: string
          enum:
            - file
        bytes:
          type: integer
          description: The file's size in bytes.
        created_at:
          type: integer
          description: When the file was uploaded, as a Unix timestamp.
        filename:
          type: string
          description: The name the file was uploaded with.
        purpose:
          type: string
          description: What the file is for. Use `batch` for Batch API input files.
        status:
          type: string
          description: The file's processing status.
        status_details:
          type: string
          nullable: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
      additionalProperties: false
    ErrorObject:
      type: object
      required:
        - message
        - type
      properties:
        message:
          type: string
        type:
          type: string
        param:
          oneOf:
            - type: string
            - type: 'null'
        code:
          oneOf:
            - type: string
            - type: integer
            - type: 'null'
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````