---
title: "Upload a file to short-lived CDN storage"
method: POST
path: "/v2/uploads"
tags: ["Uploads"]
---

# Upload a file to short-lived CDN storage

`POST /v2/uploads`

## Request

- Base URL: `https://api.apiframe.ai`
- URL: `https://api.apiframe.ai/v2/uploads`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Single-file multipart upload (max 25 MB image / audio, 50 MB video). Magic-byte sniffed — declared content-type is ignored. Returns a CDN URL drop-in for any image / video / audio input field. Files live ~1-2h before the cleanup worker reaps them.

## Response `201`

Uploaded file metadata + CDN URL.

- Upload: Short-lived CDN-hosted upload. The URL drops straight into any `start_image` / `image` / `video` field in the generation schemas.
  - `id` string, uuid, required
  - `url` string, uri, required
  - `kind` 'image' | 'video' | 'audio', required
  - `contentType` string, required
  - `byteSize` integer, required
  - `expiresAt` string, date-time, required

## Other responses

- `400`: No file, oversize, or unsupported file type.
- `401`: Authentication failed (missing / invalid API key).
- `403`: Authenticated but the API key is inactive or lacks permission.
- `429`: Rate limit exceeded. Retry after the `Retry-After` seconds.
- `502`: Upstream CDN upload failed.

---

[API](https://skmtc.dev/apiframe/apis/apiframe-api.md) · [All operations](https://skmtc.dev/apiframe/apis/apiframe-api/llms.txt) · [OpenAPI document](https://skmtc.dev/apiframe/apis/apiframe-api/revisions/ba1a4c26c86a?raw)
