> ## 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 upload URL

> Get a presigned URL for uploading a batch input file. See [Batch](https://docs.liquid.ai/api/guides/batch).



## OpenAPI

````yaml /api/openapi.json post /v1/files
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:
  /v1/files:
    post:
      tags:
        - Large uploads
      summary: Create upload URL
      description: >-
        Get a presigned URL for uploading a batch input file. See
        [Batch](https://docs.liquid.ai/api/guides/batch).
      operationId: create-upload-url
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                purpose:
                  type: string
                  description: Must be "batch".
                filename:
                  type: string
                  description: The file name (max 255 characters).
                bytes:
                  type: integer
                  description: >-
                    The file size in bytes. Rejected up front if over the 200 MB
                    limit.
                mime_type:
                  type: string
                  description: Content type of the upload. Defaults to application/jsonl.
              required:
                - purpose
                - filename
                - bytes
            example:
              purpose: batch
              filename: batch_input.jsonl
              bytes: 137587646
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              example:
                id: file_abc123
                object: file
                bytes: 137587646
                created_at: 1730419200
                filename: batch_input.jsonl
                purpose: batch
                status: processed
                upload_url: https://storage.example.com/...
                upload_expires_at: 1730422800
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The file id, referenced when creating a batch.
                  object:
                    type: string
                    description: Always "file".
                  bytes:
                    type: integer
                    description: Size of the file in bytes.
                  created_at:
                    type: integer
                    description: Unix timestamp (seconds) of creation.
                  filename:
                    type: string
                    description: The name the file was uploaded with.
                  purpose:
                    type: string
                    description: >-
                      Either "batch" (an input) or "batch_output" (a generated
                      result/error file).
                  status:
                    type: string
                    description: Always "processed"; stored files are ready.
                  expires_at:
                    type: integer
                    description: Unix timestamp (seconds) when the file expires, if set.
                  upload_url:
                    type: string
                    description: A short-lived presigned URL. PUT the file bytes here.
                  upload_expires_at:
                    type: integer
                    description: Unix timestamp (seconds) when the upload URL expires.
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -X POST https://api.liquid.ai/v1/files \
              -H "Authorization: Bearer $LIQUID_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "purpose": "batch",
                "filename": "batch_input.jsonl",
                "bytes": 137587646
              }'
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.