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

# ファイルをアップロード

> Upload a file, tagged with what it will be used for.



## OpenAPI

````yaml latest.yml POST /files
openapi: 3.0.1
info:
  title: Cartesia API
  version: 0.0.1
servers:
  - url: https://api.cartesia.ai
    description: Production
security: []
paths:
  /files:
    post:
      tags:
        - Files
      description: Upload a file, tagged with what it will be used for.
      operationId: files_upload
      parameters:
        - $ref: '#/components/parameters/CartesiaVersionHeader'
      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:
                  allOf:
                    - $ref: '#/components/schemas/FilePurpose'
                  example: agent_background_sound
                  description: What the file will be used for.
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '400':
          description: >-
            The file is not valid for the given purpose (for example, a
            non-audio file uploaded as `agent_background_sound`).
        '413':
          description: >-
            The file exceeds the maximum upload size (`error_code:
            file_too_large`).
        '429':
          description: Upload quota exceeded.
      security:
        - APIKeyAuth: []
components:
  parameters:
    CartesiaVersionHeader:
      name: Cartesia-Version
      in: header
      description: API version header.
      required: true
      schema:
        type: string
        format: date
        example: '2026-03-01'
        default: '2026-03-01'
        enum:
          - '2026-03-01'
  schemas:
    FilePurpose:
      title: FilePurpose
      type: string
      description: What a file is used for.
      enum:
        - agent_background_sound
        - fine_tune
        - tts_generation
        - voice-clone
    File:
      title: File
      type: object
      description: An uploaded file.
      properties:
        id:
          type: string
          description: Unique identifier for the file, prefixed with `file_`.
          example: file_EneDabCuJCpfe5CFi5X12e
        filename:
          type: string
          description: Original filename.
          example: background-sound.wav
        purpose:
          allOf:
            - $ref: '#/components/schemas/FilePurpose'
          example: agent_background_sound
        size:
          type: integer
          description: Size of the file in bytes.
          example: 2048576
        status:
          type: string
          description: Processing status of the file.
          example: ready
        owner_id:
          type: string
          description: ID of the account that owns the file.
          example: org_2x6zg1zx5cnZJHwZCJypdW6YIiC
        created_at:
          type: string
          format: date-time
          description: Timestamp when the file was created.
          example: '2026-07-25T18:30:00.000Z'
      required:
        - id
        - filename
        - purpose
        - size
        - status
        - owner_id
        - created_at
  securitySchemes:
    APIKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Cartesia API key (`sk_car_...`). Get one at
        [play.cartesia.ai/keys](https://play.cartesia.ai/keys).
      x-default: $CARTESIA_API_KEY

````