Direct generation API for images, video, transcription, and prompt enhancement.
List models
GET /api/ai/models
Returns:
{
"image": [
{ "id": "openai/gpt-image-1", "label": "GPT Image 1", "provider": "openai" },
{ "id": "wavespeed/flux-2", "label": "FLUX.2 Dev [Wavespeed]", "provider": "wavespeed" },
…
],
"video": [ … ],
"chat": [ … ]
}
Only models for providers with a configured key are returned.
Generate image
POST /api/ai/generate
{
"board_id": "…",
"model": "wavespeed/flux-2",
"prompt": "…",
"aspect_ratio": "16:9",
"input_image_url": "/media/…", // optional
"negative_prompt": "…", // optional
"params": { … } // model-specific
}
Returns:
{
"element": { "id": "…", "type": "image", "url": "/media/…" },
"history_entry_id": "…",
"cost_estimate": 0.012
}
The element is already added to the board.
For video models, use the same endpoint with a video model ID — the response includes a status: "queued" payload for providers (like Kling) that queue jobs. Poll with GET /api/ai/jobs/{job_id}.
Prompt enhancer
POST /api/ai/prompt-enhancer/analyze
{
"prompt": "…",
"reference_image_url": "/media/…",
"model": "anthropic/claude-sonnet"
}
Returns:
{ "enhanced_prompt": "…" }
Transcribe audio
POST /api/ai/transcribe
{
"board_id": "…",
"element_id": "…",
"language": null // auto-detect
}
Returns:
{
"text": "…",
"language": "en"
}
Leave a Reply