Initiate a direct upload (presigned PUT URL)
Reserve a media id and get a presigned URL for uploading a local video, audio, or image file of up to 5 GiB. PUT the raw bytes to that URL, then call POST /v1/media/{id}/finalize to start processing.
API key auth. Prefix cf_live_ for production orgs, cf_test_ for sandbox.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
POST /media upload initiation body.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/media" \ -H "Content-Type: application/json" \ -d '{ "filename": "string", "contentType": "video/mp4", "size": 1 }'{ "id": "string", "uploadUrl": "http://example.com", "expiresAt": "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 } }}{ "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 } }}Request cancellation of a hosted processing run POST
Ask a hosted processing run to stop, and get back its status plus whether a remote stop was requested. A request is not proof the work stopped, so poll the run afterward; a finished run is returned unchanged.
Mint a short-lived token for the signed upload lane POST
Get a token for the signed resumable upload lane used by browser and desktop uploaders, valid for about 30 minutes and optionally scoped to one project. API clients should use POST /v1/media for a presigned PUT instead.