Finalize a direct upload (trigger processing after the bytes are PUT)
Confirm the bytes reached the presigned URL and start processing, the step after POST /v1/media. Audio and video move to processing while images complete at once; optionally declare an audio role of vo, music, sfx, or ambience.
API key auth. Prefix cf_live_ for production orgs, cf_test_ for sandbox.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
POST /media/:id/finalize body — optional declared audioRole.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/media/string/finalize" \ -H "Content-Type: application/json" \ -d '{}'{ "id": "string", "status": "processing", "processingPhase": "string"}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "x402Version": 2, "accepts": [ {} ], "error": "string"}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}{ "error": { "code": "string", "message": "string", "contract": "string", "contractVersion": "string", "details": { "property1": null, "property2": null } }}Delete a media item DELETE
Delete a media item that is no longer needed. Refused with media_in_use, naming the projects and sessions involved, while anything still references it, so remove those references first.
Generate media with AI (video, image, or audio) POST
Generate a new media item from a text prompt: text-to-video, text-to-image, image-to-video, speech, music, or sound effects (generator 'auto' selects the supported model). Async — returns a media id that flips to ready when generation finishes; poll GET /media/:id or register a media.completed webhook. Priced on what the model actually costs; refused with 402 if your balance cannot cover the quote (see GET /me).