/docs/en/api/media/Twelver Media Generation API: Image, Video, Music & Speech
Async request and response schema for POST/v1/media/files, POST/v1/media/generations, polling GET/v1/media/generations/:taskId, and media toolsets.
Async Task Lifecycle#
The Media API uses the same Bearer sk-… key under /api/ai/<config-id>/v1/media. Each job runs the requested media toolsets and retains task state in Redis for 24 hours.
- POST
https://twelver.app/api/ai/<config-id>/v1/media/files— upload an input asset (multipart/form-data, field file) for image-to-image, image-to-video, or transcription; returns a signed URL to pass in files. - POST
https://twelver.app/api/ai/<config-id>/v1/media/generations— start a generation task ({ id, status:"running", output, error }). - GET
https://twelver.app/api/ai/<config-id>/v1/media/generations/:taskId— poll status ("running"|"completed"|"failed") and read finished signed URLs from output.files. - GET
https://twelver.app/api/ai/<config-id>/v1/media/generations/schema— inspect the live request/response schema and registered toolset slugs.
Request & Response Schema (@contract/media-api)#
Exact JSON shape validated by the router and returned by GET/schema:
Public Media Toolset IDs#
Pass one or more of the following toolset slugs in the toolsets array:
| Toolset ID | Category | Required plan | Tools exposed |
|---|---|---|---|
| image-generation | image | Any (incl. starter) | describe-image, text-to-image, image-to-image, images-to-image |
| grok-image-generation | image | Pro+ | grok-text-to-image, grok-image-to-image, grok-images-to-image |
| seedream-image-generation | image | Pro+ | seedream-text-to-image, seedream-image-to-image, seedream-multi-image-blend |
| ideogram-image-generation | image | Pro+ | ideogram-generate, ideogram-remix, ideogram-edit, ideogram-remove-background, ideogram-vectorize |
| grok-video-generation | video | Pro+ | grok-text-to-video, grok-image-to-video, grok-video-to-video, grok-reference-images-to-video |
| seedance-video-generation | video | Any (incl. starter) | seedance-text-to-video, seedance-image-to-video, seedance-multimodal-to-video, seedance-edit-video, seedance-extend-video, seedance-finalize-video |
| seedance-economy-video | video | Any (incl. starter) | seedance-economy-text-to-video, seedance-economy-image-to-video, seedance-economy-multimodal-to-video, seedance-economy-edit-video, seedance-economy-extend-video |
| google-video-generation | video | Any (incl. starter) | google-text-to-video, google-image-to-video, google-reference-images-to-video, google-edit-video, google-extend-video |
| hailuo-video-generation | video | Any (incl. starter) | hailuo-text-to-video, hailuo-image-to-video, hailuo-frames-to-video, hailuo-reference-to-video, hailuo-regenerate-video |
| happyhorse-video-generation | video | Any (incl. starter) | happyhorse-text-to-video, happyhorse-image-to-video, happyhorse-reference-to-video, happyhorse-edit-video |
| wan-video-generation | video | Pro+ | wan-text-to-video, wan-image-to-video, wan-reference-to-video, wan-edit-video |
| media-manipulation | video | Any (incl. starter) | media-video-stitch, media-video-trim, media-video-crop, media-video-resize, media-video-add-audio, media-video-extract-audio, media-video-extract-frame, media-video-contact-sheet, media-video-to-gif, media-images-to-video, media-video-overlay-image, media-video-inspect, media-audio-stitch, media-audio-trim, media-audio-mix, media-image-resize, media-image-crop, media-image-rotate, media-image-split-grid |
| google-music | audio | Any (incl. starter) | google-text-to-music |
| minimax-music | audio | Any (incl. starter) | minimax-text-to-music, minimax-music-cover, minimax-music-cover-analyze, minimax-generate-lyrics |
| google-audio-speech | audio | Any (incl. starter) | google-text-to-speech, google-text-to-speech-dialogue, google-voice-design, google-list-voices |
| qwen-audio-speech | audio | Any (incl. starter) | qwen-text-to-speech, qwen-voice-clone, qwen-list-voices |
| grok-audio-speech | audio | Any (incl. starter) | grok-text-to-speech |
| speech-to-text | audio | Any (incl. starter) | transcribe-audio, transcribe-video |
| web-search | search | Any (incl. starter) | web-search, web-crawl |
| perplexity-search | search | Any (incl. starter) | perplexity-search, perplexity-read |
| image-search | search | Any (incl. starter) | image-search-by-text, image-search-by-image, image-search-fetch |
| document | documents | Any (incl. starter) | write-document, create-document, update-document, read-document, export-document |
| code | documents | Any (incl. starter) | write-code, create-code, update-code |
| webapp | documents | Any (incl. starter) | write-webapp, create-webapp, update-webapp, publish-webapp |
| presentation | documents | Any (incl. starter) | write-presentation, create-presentation, update-presentation |
| graphic | documents | Any (incl. starter) | write-graphic, create-graphic, update-graphic |
| agents | other | Any (incl. starter) |
Frequently Asked Questions
How does async media generation work from start to finish?
Submit POSThttps://twelver.app/api/ai/<config-id>/v1/media/generations with toolset, tool, and params to receive HTTP 202 and a taskId, then poll GEThttps://twelver.app/api/ai/<config-id>/v1/media/generations/:taskId until status reaches completed or failed.
How do I pass source images, audio, or video into a media task?
Upload the file as multipart/form-data to POSThttps://twelver.app/api/ai/<config-id>/v1/media/files and pass the returned fileId inside params (for example, imageFileIds or audioFileId).
How long are media task records retained for polling?
Task state remains queryable for 24 hours after creation; download completed media outputs to your own storage once finished.
Inspect raw Markdown (LLM / @Docs source)
# Twelver Media Generation API: Image, Video, Music & Speech
> Async request and response schema for POST /v1/media/files, POST /v1/media/generations, polling GET /v1/media/generations/:taskId, and media toolsets.
Canonical URL: https://twelver.app/docs/en/api/media/
## Async Task Lifecycle
The Media API uses the same Bearer sk-… key under /api/ai/<config-id>/v1/media. Each job runs the requested media toolsets and retains task state in Redis for 24 hours.
- POST https://twelver.app/api/ai/<config-id>/v1/media/files — upload an input asset (multipart/form-data, field file) for image-to-image, image-to-video, or transcription; returns a signed URL to pass in files.
- POST https://twelver.app/api/ai/<config-id>/v1/media/generations — start a generation task ({ id, status: "running", output, error }).
- GET https://twelver.app/api/ai/<config-id>/v1/media/generations/:taskId — poll status ("running" | "completed" | "failed") and read finished signed URLs from output.files.
- GET https://twelver.app/api/ai/<config-id>/v1/media/generations/schema — inspect the live request/response schema and registered toolset slugs.
**curl — submit & poll a generation job**
```bash
# 1. Submit a generation job
curl -X POST "https://twelver.app/api/ai/<config-id>/v1/media/generations" \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"prompt": "Minimalist geometric emblem on a clean white background",
"toolsets": [
"image-generation"
]
}'
# 2. Poll task status (24h TTL)
curl "https://twelver.app/api/ai/<config-id>/v1/media/generations/<task-id>" \
-H "Authorization: Bearer sk-..."
```
## Request & Response Schema (@contract/media-api)
Exact JSON shape validated by the router and returned by GET /schema:
**MEDIA_API_SCHEMA**
```json
{
"request": {
"prompt": "string",
"toolsets": [
"string"
],
"files": [
{
"url": "string",
"content_type": "string",
"description": "string"
}
]
},
"response": {
"status": "running | completed | failed",
"id": "string",
"error": {
"message": "string"
},
"output": {
"text": "string",
"files": [
{
"url": "string",
"content_type": "string",
"description": "string"
}
]
}
}
}
```
## Public Media Toolset IDs
Pass one or more of the following toolset slugs in the toolsets array:
| Toolset ID | Category | Required plan | Tools exposed |
| --- | --- | --- | --- |
| image-generation | image | Any (incl. starter) | describe-image, text-to-image, image-to-image, images-to-image |
| grok-image-generation | image | Pro+ | grok-text-to-image, grok-image-to-image, grok-images-to-image |
| seedream-image-generation | image | Pro+ | seedream-text-to-image, seedream-image-to-image, seedream-multi-image-blend |
| ideogram-image-generation | image | Pro+ | ideogram-generate, ideogram-remix, ideogram-edit, ideogram-remove-background, ideogram-vectorize |
| grok-video-generation | video | Pro+ | grok-text-to-video, grok-image-to-video, grok-video-to-video, grok-reference-images-to-video |
| seedance-video-generation | video | Any (incl. starter) | seedance-text-to-video, seedance-image-to-video, seedance-multimodal-to-video, seedance-edit-video, seedance-extend-video, seedance-finalize-video |
| seedance-economy-video | video | Any (incl. starter) | seedance-economy-text-to-video, seedance-economy-image-to-video, seedance-economy-multimodal-to-video, seedance-economy-edit-video, seedance-economy-extend-video |
| google-video-generation | video | Any (incl. starter) | google-text-to-video, google-image-to-video, google-reference-images-to-video, google-edit-video, google-extend-video |
| hailuo-video-generation | video | Any (incl. starter) | hailuo-text-to-video, hailuo-image-to-video, hailuo-frames-to-video, hailuo-reference-to-video, hailuo-regenerate-video |
| happyhorse-video-generation | video | Any (incl. starter) | happyhorse-text-to-video, happyhorse-image-to-video, happyhorse-reference-to-video, happyhorse-edit-video |
| wan-video-generation | video | Pro+ | wan-text-to-video, wan-image-to-video, wan-reference-to-video, wan-edit-video |
| media-manipulation | video | Any (incl. starter) | media-video-stitch, media-video-trim, media-video-crop, media-video-resize, media-video-add-audio, media-video-extract-audio, media-video-extract-frame, media-video-contact-sheet, media-video-to-gif, media-images-to-video, media-video-overlay-image, media-video-inspect, media-audio-stitch, media-audio-trim, media-audio-mix, media-image-resize, media-image-crop, media-image-rotate, media-image-split-grid |
| google-music | audio | Any (incl. starter) | google-text-to-music |
| minimax-music | audio | Any (incl. starter) | minimax-text-to-music, minimax-music-cover, minimax-music-cover-analyze, minimax-generate-lyrics |
| google-audio-speech | audio | Any (incl. starter) | google-text-to-speech, google-text-to-speech-dialogue, google-voice-design, google-list-voices |
| qwen-audio-speech | audio | Any (incl. starter) | qwen-text-to-speech, qwen-voice-clone, qwen-list-voices |
| grok-audio-speech | audio | Any (incl. starter) | grok-text-to-speech |
| speech-to-text | audio | Any (incl. starter) | transcribe-audio, transcribe-video |
| web-search | search | Any (incl. starter) | web-search, web-crawl |
| perplexity-search | search | Any (incl. starter) | perplexity-search, perplexity-read |
| image-search | search | Any (incl. starter) | image-search-by-text, image-search-by-image, image-search-fetch |
| document | documents | Any (incl. starter) | write-document, create-document, update-document, read-document, export-document |
| code | documents | Any (incl. starter) | write-code, create-code, update-code |
| webapp | documents | Any (incl. starter) | write-webapp, create-webapp, update-webapp, publish-webapp |
| presentation | documents | Any (incl. starter) | write-presentation, create-presentation, update-presentation |
| graphic | documents | Any (incl. starter) | write-graphic, create-graphic, update-graphic |
| agents | other | Any (incl. starter) | |
## Frequently Asked Questions
### How does async media generation work from start to finish?
Submit POST https://twelver.app/api/ai/<config-id>/v1/media/generations with toolset, tool, and params to receive HTTP 202 and a taskId, then poll GET https://twelver.app/api/ai/<config-id>/v1/media/generations/:taskId until status reaches completed or failed.
### How do I pass source images, audio, or video into a media task?
Upload the file as multipart/form-data to POST https://twelver.app/api/ai/<config-id>/v1/media/files and pass the returned fileId inside params (for example, imageFileIds or audioFileId).
### How long are media task records retained for polling?
Task state remains queryable for 24 hours after creation; download completed media outputs to your own storage once finished.