API v1

Register an asset

POST/v1/assets

Requires service.use.

View Markdown
  • Put your API key after Authorization: Bearer; the key needs service.use permission.
  • Send an Idempotency-Key; the same request replays the original response and a different one is refused.
  • After acceptance the file is fetched and checked in the background; read its status at Location.
  • Only active assets can be referenced with asset:// in generation requests.

Headers

#AuthorizationstringRequired

Bearer, a space and your API key. A missing or invalid key returns 401 authentication_failed.

#Content-TypestringRequired

The body is JSON: application/json.

#X-Request-IDstring

Your own request identifier. An invalid or repeated value is replaced; the value used comes back in the X-Request-ID response header.

#Idempotency-KeystringRequired

Generate a new value for every new request and save it; it starts with a letter or digit. When the outcome is unknown, retry with the same key and the original body to get the original response; the same key with a different body returns 409 idempotency_conflict. Keys belong to your team, not to one API key.

Length8–128CharactersA–Z a–z 0–9 . _ : -

Request bodyapplication/json · Required

The body accepts only the fields below; any other field is rejected.

#urlstringRequired

Public HTTPS address of the source file, up to 2048 UTF-8 bytes. User information in the URL is rejected, as are destinations outside the fetch policy.

Length9–2048Formathttps://
#media_typestringRequired

The kind of media in this file.

One ofimageaudiovideo
#modelstringRequired

ID of the model used for this request.

dreamina-seedance-2-0-260128Seedance 2.0
dreamina-seedance-2-0-fast-260128Seedance 2.0 Fast
dreamina-seedance-2-0-mini-260615Seedance 2.0 Mini
#namestring

Optional display name. Control characters, line or paragraph separators and bidirectional text controls are not accepted.

Length1–64

ReturnsHTTP 202

Asset intake was accepted. Follow Location to check its progress.

#asset_idstringRequired

ID assigned to the asset by the platform.

Length36–36Formatast- and 32 hex digits
#statusstringRequired

Current state; see the value notes for its meaning.

Alwaysprocessing

Response headers

#X-Request-IDstringRequired

The identifier of this request: the valid value you sent, or its replacement.

#Cache-ControlstringRequired

Instructs clients not to cache the response.

#LocationstringRequired

Canonical relative lookup path for the accepted object.

Status codes

Each error.code and what to do about it is on Error codes.

StatusMeaning and error.code
202Asset intake was accepted.
Response headersCache-ControlLocation
400The request is invalid or the source address fails the HTTPS fetch policy.
401The API key is missing or invalid.
Response headersWWW-Authenticate
403This API key does not have service.use permission.
409Your team already used this idempotency value for a different canonical asset registration request.
410The saved acceptance response is too old to replay exactly.
429The asset cannot be accepted within your team's stored-byte allowance or intake capacity.
503The service is temporarily unavailable.