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

# file upload base64

> Get a public media URL, available for 24 hours.

## Input

Bearer API key required. upload uses multipart/form-data; the other methods use JSON. uploadPath is a relative logical path; fileName is optional. Storage uses account-scoped immutable object versions, so a later upload does not replace a file used by an existing task.

Stream/URL uploads: up to 500 MiB. URL requests time out after 30 seconds; up to 100 MiB is recommended. Base64 decoded uploads have a platform limit of 10 MiB; use URL or stream uploads for larger files. Model input limits are validated separately.

```json theme={null}
{
  "base64Data": "data:audio/wav;base64,...",
  "uploadPath": "audio",
  "fileName": "sample.wav"
}
```

## Output

```json theme={null}
{
  "success": true,
  "code": 200,
  "msg": "File uploaded successfully",
  "data": {
    "fileName": "sample.wav",
    "filePath": "audio/sample.wav",
    "downloadUrl": "https://files.apistable.ai/uploads/account/version/sample.wav",
    "fileSize": 245760,
    "mimeType": "audio/wav",
    "uploadedAt": "2026-11-01T00:00:00Z",
    "expiresAt": "2026-11-02T00:00:00Z"
  }
}
```


## OpenAPI

````yaml openapi.json POST /api/v1/files/upload_base64
openapi: 3.1.0
info:
  title: APIstable API
  version: 1.0.0-preview
  description: >-
    Public /api/v1 protocol. Valid API keys have the same account-scoped access.
    Read the selected model documentation for its ID, supported inputs, result
    format and availability before submitting. No client submission idempotency
    or max_credits. Availability, pricing, file retention and callback formats
    follow the selected model contract. Unconfigured operations return 503.
servers:
  - url: https://apistable.ai
    description: APIstable API
security: []
paths:
  /api/v1/files/upload_base64:
    post:
      summary: 'Upload media: upload_base64'
      description: >-
        Uploaded files expire after 24 hours. Account-scoped immutable object
        versions. Stream/URL maximum 500 MiB; Base64 decoded maximum 10 MiB.
      operationId: file_upload_base64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - base64Data
              additionalProperties: false
              properties:
                base64Data:
                  type: string
                uploadPath:
                  type: string
                  default: files
                fileName:
                  type: string
      responses:
        '200':
          description: Uploaded
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - code
                  - msg
                  - data
                properties:
                  success:
                    const: true
                  code:
                    const: 200
                  msg:
                    type: string
                  data:
                    type: object
                    required:
                      - fileName
                      - filePath
                      - downloadUrl
                      - fileSize
                      - mimeType
                      - uploadedAt
                      - expiresAt
                    properties:
                      fileName:
                        type: string
                      filePath:
                        type: string
                      downloadUrl:
                        type: string
                        format: uri
                      fileSize:
                        type: integer
                      mimeType:
                        type: string
                      uploadedAt:
                        type: string
                        format: date-time
                      expiresAt:
                        type: string
                        format: date-time
        '401':
          description: '40101: Invalid API key.'
        '503':
          description: Operation or provider unavailable
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Every valid key can submit and query its own account. Revoked keys are
        rejected.

````

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