Media API
Discover media presets, estimate cost, start generation, and inspect results.Endpoints
Section titled “Endpoints”| Method | Path | Request | Response |
|---|---|---|---|
GET | /api/media/presets | — | MediaPresetList |
GET | /api/media/recommendations | intent query | MediaPresetList |
POST | /api/media/estimates | MediaEstimateRequest | MediaEstimate |
POST | /api/media/generations | MediaGenerationRequest | MediaGeneration |
GET | /api/media/generations | limit query | MediaGenerationList |
GET | /api/media/generations/{operationId} | path parameter | MediaGenerationEnvelope |
List presets
Section titled “List presets” GET
/api/media/presets curl https://app.dexto.ai/api/media/presets \ -H "Authorization: Bearer $DEXTO_API_KEY"| Response field | JSON type | Required | Description |
|---|---|---|---|
presets | array<MediaPreset> | Yes | Presets available in this deployment |
presets[].id | string | Yes | Stable preset identifier |
presets[].title | string | Yes | Display name |
presets[].description | string | Yes | Intended use |
presets[].mediaKind | image | video | audio | Yes | Output media kind |
presets[].arguments | object | Yes | Argument contract for the preset |
Create estimate
Section titled “Create estimate” POST
/api/media/estimates curl https://app.dexto.ai/api/media/estimates \ -H "Authorization: Bearer $DEXTO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "preset":"image.quality", "arguments":{"prompt":"A precise exploded diagram of a mechanical keyboard"} }'{ "estimateId":"724df530-01e7-45f6-a73b-756401b51d31", "preset":"image.quality", "amountUsd":0.042, "expiresAt":"2026-09-13T10:15:00.000Z", "normalizedInput":{"prompt":"A precise exploded diagram of a mechanical keyboard"}}| Request field | JSON type | Required | Description |
|---|---|---|---|
preset | string | Yes | ID returned by the presets endpoint |
arguments | object | Yes | Values matching the preset’s input schema |
Start generation
Section titled “Start generation” POST
/api/media/generations curl https://app.dexto.ai/api/media/generations \ -H "Authorization: Bearer $DEXTO_API_KEY" \ -H "Idempotency-Key: $REQUEST_ID" \ -H "Content-Type: application/json" \ -d '{"estimateId":"724df530-01e7-45f6-a73b-756401b51d31"}'The estimate is single-use. Reuse the same Idempotency-Key when retrying a request. Inline generations return 200 with completed resources. Asynchronous generations return 202; poll the returned generation ID.
Get generation
Section titled “Get generation” GET
/api/media/generations/{operationId} { "generation": { "id": "b8698bf3-df63-4c31-bdec-929fd0c9104e", "preset": "video.text.seedance-2", "mediaKind": "video", "status": "settled", "resources": [ { "id": "artifact_01K4MA2B", "kind": "video", "mimeType": "video/mp4", "url": "https://app.dexto.ai/api/artifacts/exports/…" } ], "error": null, "createdAt": "2026-09-13T10:00:00.000Z", "updatedAt": "2026-09-13T10:03:21.000Z", "completedAt": "2026-09-13T10:03:19.000Z" }}| Field | JSON type | Required | Description |
|---|---|---|---|
generation.id | string | Yes | Polling identifier |
generation.preset | string | Yes | Selected preset |
generation.mediaKind | string | Yes | image, video, or audio |
generation.status | string | Yes | Durable operation state |
generation.resources | array<Resource> | Yes | Result artifacts and downloadable URLs |
generation.error | object | null | Yes | Structured failure category and message |
generation.completedAt | string | null | Yes | ISO-8601 completion timestamp |