Skip to content

Legacy Compatibility ​

This page is for clients that already use legacy upload requests or historical assets. For a new integration, start with Upload Assets: create an asset, prepare it for the target model, then check its state. Archive it separately when you need a hosted copy.

Request Format and Record Semantics ​

A legacy request format does not necessarily create a legacy record. The V2 compatibility upload flow creates a trusted content snapshot from the old request format. Existing historical records are not automatically upgraded by a service update or a request header.

CaseInput and behaviorReading the result
Strict V2 creationPOST /v1/assets with Asset-Contract: v2. Does not accept model / mode; creation and model preparation are separate.Check asset identity, storage, and the target model's preparation separately. Creation does not prepare the asset for a model.
Legacy upload request handled by V2POST /v1/assets/uploads without a V2 contract header, using legacy fields such as mode. Even mode=asset first creates a trusted hosted snapshot, then prepares the target model.The url / source_url aliases contain only safe hosted URLs, not the original input URL. Check preparation for the same target model.
Historical record not yet upgradedRetains its original lifecycle and URL semantics. Legacy mode=asset does not establish that a hosted copy exists.Interpret the historical fields on this page. Query and explicitly Prepare when current model readiness needs confirmation.

MoonApiX-Asset-Contract: v2 remains a supported header alias. Set only one contract header per request. POST /v1/assets/uploads with either V2 contract header also selects strict V2 creation: do not combine it with a legacy model / mode body. Successful V2 responses use the canonical Asset-Contract: v2 response header.

For a compatibility upload that only archives to OSS, omitting model omits preparation and the old top-level preparation aliases. Supplying model only reads its preparation projection; it does not start preparation. An unavailable or unauthorized model does not prevent identity creation and OSS archiving; the problem is reflected in preparation. Once established, asset_id and identity status=ready remain even if archiving or preparation fails.

Legacy Endpoints ​

OperationPathCompatibility endpoint
UploadPOST /v1/assets/uploadsPOST /api/asset/createMedia
ListGET /v1/assetsUse the existing list endpoint.
Get detailsGET /v1/assets/{asset_id}GET /api/asset/get

Use the canonical paths in new code. See Query Assets for list and detail parameters, and Manage Assets for renaming, moving, and deletion.

Upload from a Public URL ​

This example uses the legacy request format and does not set a V2 contract header. Snapshot creation and returned URLs follow the distinction above; the old request format does not mean a newly created record only stores the original URL.

bash
curl https://moonapix.com/v1/assets/uploads \
  -H "Authorization: Bearer <MOONAPIX_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.0-kz-fast",
    "mode": "asset",
    "type": "image",
    "url": "https://example.com/reference.png"
  }'

Upload a Local File ​

bash
curl https://moonapix.com/v1/assets/uploads \
  -H "Authorization: Bearer <MOONAPIX_API_KEY>" \
  -F "file=@./reference.png" \
  -F "type=image" \
  -F "purpose=video_reference" \
  -F "mode=oss"

The pre-V2 upload flow only supports file uploads with mode=oss or mode=both. The V2 compatibility flow also supports files with mode=asset when a target model that supports asset preparation is specified. Strict V2 creation does not use mode.

FieldPurpose
file / urlA local file or an existing public direct URL. JSON also supports urls; each URL creates an asset record.
typeAsset type, such as image, audio, or video.
modelThe public target model for asset preparation. Check its asset strategy first.
modeLegacy upload mode; see below.
group_idOptional; defaults to the default group. For a liveness verification group, use the group_id returned by verification; that group can initially be empty.
purposeOptional; for example, video_reference, digital_human_avatar, or voice_training.

Historical Mode Semantics ​

The original URL and hosting behavior below only describes historical records that have not been upgraded. Newly created V2 compatibility records follow the compatibility upload rules.

ModeHistorical storage behaviorCommon result
assetStores the customer's public URL and creates an asset reference.asset_id, asset_ref; url usually equals the original source_url.
ossCreates a MoonApiX OSS test URL.asset_id, url, oss_url; this does not establish model readiness.
bothCreates a hosted copy and an asset reference.asset_id, asset_ref, url, oss_url; preparation still needs a separate check.

MoonApiX OSS is for integration and testing. It does not guarantee long-term retention, URL validity, or continuous availability. For production, use stable, anonymously accessible direct URLs on your own storage. New integrations use separate V2 creation, archive, and preparation operations instead of combining them through mode.

Historical Asset Fields ​

This table describes historical responses that have not been upgraded. Compatibility aliases in a V2 response retain V2 semantics; in particular, do not treat their source_url as the original input URL.

FieldHistorical meaning
objectObject type, usually asset.
id / asset_idThe MoonApiX asset ID, in the form asset_xxx.
reference / asset_refThe MoonApiX asset reference, in the form Asset://asset_xxx. You still need to include it in an asset input field of the generation request.
group_id / domainThe asset's group and usage domain; a common domain is media.
type / asset_typeAsset type, such as image, audio, video, or file.
name / descriptionAsset name and description.
source_urlThe original public URL supplied when the asset was created.
urlA customer-accessible URL. Historical mode=asset usually uses the original URL; oss / both usually use a hosted URL.
oss_urlA hosted test URL, usually present for historical mode=oss / both. Long-term validity is not guaranteed.
contentAn input fragment for generation requests; images commonly use content.image_url.url.
content_type / size / durationMIME type, size in bytes, and audio/video duration in seconds.
State and review fieldsSee Historical States and Next Actions.
visibilityUsually private.
created_at / updated_atCreation and update timestamps.
request_id / trace_idRequest and trace IDs to provide when troubleshooting.

Historical States and Next Actions ​

FieldCommon historical valuesMeaning
statuscreated, syncing, ready, failed, disabledAsset record state. ready alone does not establish target model readiness.
sync_statuscreated, syncing, ready, failedAsset reference preparation state.
preparation_statuscreated, syncing, ready, failed, disabledPreparation state before generation.
generation_readytrue / falseReadiness in the same target model and invocation scope; it does not promise immediate execution.
review_statussucceeded, pending, failed, unknownReview evidence. succeeded does not mean preparation is complete.
review_passedtrue / falseWhether review or availability checks passed; it does not replace the generation readiness check.
sync_errorstringPreparation failure reason.

For historical responses, preparation is normally checked through preparation_status=ready and generation_ready=true. Do not require every review field to be positive. review_status=unknown does not by itself block independently confirmed readiness; a successful review cannot override failed preparation.

In V2 compatibility responses, any returned sync_status / preparation_status aliases map to preparation.status in the same target model and invocation scope. They may therefore also be not_started, processing, not_required, or unknown. New code should read preparation.* instead of applying historical enums.

Query resultNext action
A confirmed historical preparation workflow is still syncingKeep the same asset_id, and wait or query again as that workflow requires. Do not repeatedly create assets.
V2 not_started, processing, or unknownExplicitly Prepare the same asset to start, advance, or confirm preparation. GET only reads saved results; waiting alone cannot establish missing evidence.
Preparation failedRead the preparation error and check content, permissions, or the asset source. Reuse the same asset_id when a retry is appropriate; use different content if the content itself is unsuitable.
Only generation_ready=false is knownQuery the complete preparation state for the target model, then decide whether to Prepare or resolve an error. Do not handle every false result by waiting and repeating GET.

For V2, generation readiness requires identity status=ready, preparation.status equal to ready or not_required, and preparation.generation_ready=true, all for the same target model and invocation scope. When changing models, query that model's preparation; do not reuse true from another scope.

Historical Response Example ​

This illustrative fragment represents a historical record that has not been upgraded. Its original URL semantics do not apply to newly created V2 records.

json
{
  "object": "asset",
  "id": "asset_xxx",
  "asset_id": "asset_xxx",
  "asset_ref": "Asset://asset_xxx",
  "reference": "Asset://asset_xxx",
  "type": "image",
  "group_id": "group_xxx",
  "source_url": "https://example.com/reference.png",
  "url": "https://example.com/reference.png",
  "oss_url": "",
  "status": "ready",
  "sync_status": "syncing",
  "preparation_status": "syncing",
  "generation_ready": false
}

The historical record exists, but this result does not establish generation readiness. Preparation can fail after review succeeds, resulting in review_status=succeeded, preparation_status=failed, and generation_ready=false. Read sync_error; do not generate based on review evidence alone. V2 retains the identity and reports the failure in the relevant preparation layer.

Switch to V2 ​

  1. Use V2 creation for new uploads. Remove legacy model / mode from creation requests, and call archive and Prepare separately when needed.
  2. Select Asset-Contract: v2 for list and detail queries. When preparation is needed, supply the target model in the detail query and read storage.* / preparation.*.
  3. Keep existing MoonApiX asset_id / asset_ref values. A request header selects a response contract; it does not validate historical content, archive it, or prepare it. Explicitly handle missing historical evidence based on the returned state.
  4. Keep creation and preparation receipts. Reuse the same asset while processing, when a result is uncertain, or when changing models; do not upload again merely to wait for readiness.

See Uploads and Assets Overview for the full workflow, or Official Asset Management for official IDs and media download URLs.