---
title: "Create a media asset"
method: POST
path: "/v2/assets/create"
tags: ["Assets"]
---

# Create a media asset

`POST /v2/assets/create`

## Request

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

Downloads the media at the given URL and stores it in APIFRAME storage. Creation is synchronous — the asset is immediately `Active` and can be referenced as `asset://{assetId}` in any media URL field of a generation request (images, videos, music, edit and upscale endpoints); the API resolves it to the stored URL before dispatching the job. Unlike `/v2/uploads` files, assets do not expire. Limits: 25 MB for images/audio, 50 MB for video; the declared `type` must match the actual file contents (magic-byte sniffed).

## Request body

- CreateAssetRequest
  - `url` string, uri, required
  - `type` 'image' | 'video' | 'audio', required

## Response `201`

Asset created and immediately usable.

- AssetCreated
  - `assetId` string, uuid, required
  - `status` 'Active', required
  - `url` string, uri, required

## Other responses

- `400`: Invalid URL/type, download failure, unsupported or mismatched file contents, or size limit exceeded.
- `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`: Asset storage 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)
