Upload assets
Upload owned image, video, and audio references.
Read as Markdown ↗POST /api/generate/assets
Requires generate scope. Send raw file bytes with the matching media Content-Type. This is not multipart upload. Optional X-Filename records the original name, truncated to 255 characters. Maximum size is 30 MiB (30 × 1024 × 1024 bytes); specific workflows can impose lower limits.
curl https://wegen.art/api/generate/assets \
-H "Authorization: Bearer $LETSGEN_API_KEY" \
-H 'Content-Type: image/png' \
-H 'X-Filename: reference.png' \
--data-binary @reference.pngThe declared type must be an image, video, or audio type supported by the canonical media validation. An accepted upload returns HTTP 201:
{
"asset": {
"id": "asset_example",
"kind": "image",
"state": "ready",
"url": "https://CURRENT_ASSET_URL"
}
}Use the asset ID, not its URL, as a generation reference. Check readiness before using a file; the URL can be null. Uploading bytes does not start media generation and does not authorize publishing. Ownership and media validation still apply.
This upload endpoint has no idempotency guarantee. Do not blindly repeat an ambiguous upload. Voice reference recordings use the separate multipart voice upload, which also transcribes the reference.