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

# Upload a file

> Upload up to 1 GB in the request body. For larger files (up to 5 GB), use an upload URL. An upload that takes longer than about 2.5 minutes is answered with a 303 redirect to its result: follow redirects (most HTTP clients do by default).



## OpenAPI

````yaml POST /v1/files
openapi: 3.1.0
info:
  title: AirCaps AI API
  version: 1.0.0
  description: >-
    Speech-to-text: A5S Async v1 (REST; English, Spanish, French, German,
    Portuguese, Hindi, Japanese, Korean and Chinese) and A5S Small V2 Streaming
    (WebSocket; English). Speaker diarization: AirCaps Diarization-v1 (REST).
    Speaker identification: AirCaps Speaker ID-v1 (REST, synchronous).
servers:
  - url: https://api.aircaps.com
security:
  - bearerAuth: []
tags:
  - name: Transcripts
  - name: Diarizations
  - name: Speakers
  - name: Files
  - name: Account
paths:
  /v1/files:
    post:
      tags:
        - Files
      summary: Upload a file
      description: >-
        Upload up to 1 GB in the request body. For larger files (up to 5 GB),
        use an upload URL. An upload that takes longer than about 2.5 minutes is
        answered with a 303 redirect to its result: follow redirects (most HTTP
        clients do by default).
      operationId: uploadFile
      requestBody:
        required: true
        description: The raw file bytes (any audio format).
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '201':
          description: File stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
              example:
                id: file_01k6z3m4q8w7e5r2t1y0u9i8o7
                object: file
                size_bytes: 115200044
                created_at: '2026-10-06T18:01:02Z'
                expires_at: '2026-10-07T18:01:02Z'
        '400':
          description: 'Empty request body. Codes: `invalid_request`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request_error
                  code: invalid_request
                  message: empty request body; send the audio bytes as the body
                  param: null
                  request_id: req_01k6z3m4q8w7e5r2t1y0u9i8o7
        '401':
          description: 'Missing or invalid API key. Codes: `unauthorized`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: authentication_error
                  code: unauthorized
                  message: invalid API key
                  param: null
                  request_id: req_01k6z3m4q8w7e5r2t1y0u9i8o7
        '403':
          description: >-
            The account may not upload. Codes: `account_suspended`,
            `account_disabled`, `model_access_denied`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: permission_error
                  code: model_access_denied
                  message: >-
                    This account does not have access to A5S Async v1. To get
                    access, talk to sales at https://aircaps.ai/contact.
                  param: null
                  request_id: req_01k6z3m4q8w7e5r2t1y0u9i8o7
        '413':
          description: 'Larger than 1 GB. Codes: `file_too_large`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request_error
                  code: file_too_large
                  message: >-
                    direct uploads are limited to 1 GB; use /v1/files/upload-url
                    for larger files (up to 5 GB)
                  param: null
                  request_id: req_01k6z3m4q8w7e5r2t1y0u9i8o7
        '500':
          description: >-
            Server error. Safe to retry (use the same Idempotency-Key). Codes:
            `internal_error`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: api_error
                  code: internal_error
                  message: internal error
                  param: null
                  request_id: req_01k6z3m4q8w7e5r2t1y0u9i8o7
        '503':
          description: >-
            Temporarily unavailable. Retry after the Retry-After interval.
            Codes: `service_unavailable`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: api_error
                  code: service_unavailable
                  message: temporarily unavailable; please retry
                  param: null
                  request_id: req_01k6z3m4q8w7e5r2t1y0u9i8o7
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
components:
  schemas:
    File:
      type: object
      required:
        - id
        - object
        - size_bytes
        - created_at
        - expires_at
      properties:
        id:
          type: string
          example: file_01k6z3m4q8w7e5r2t1y0u9i8o7
          description: Use as `file_id`.
        object:
          type: string
          enum:
            - file
        size_bytes:
          type: integer
          example: 115200044
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          description: >-
            Usable until this time (24 hours after upload); the file is deleted
            within the following 24 hours, or right away when a transcript that
            used it is deleted.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - api_error
            code:
              type: string
              description: Machine-readable code; see [Errors](/errors).
            message:
              type: string
            param:
              type:
                - string
                - 'null'
              description: The request field at fault, if any.
            request_id:
              type:
                - string
                - 'null'
              description: >-
                Also in the `x-request-id` header. Include it when contacting
                support. `null` on 502/504 from the edge.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key: `Authorization: Bearer aircaps_sk_...`'

````

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