Generate an image
generate_imageCreates an image from a text prompt using a Kunavo image model, returning its URL or a task ID. Charges prepaid balance per image; accepts size, resolution tier, and an idempotency key.
Instructions
Generate an image from a text prompt with a Kunavo image model (endpoint image in list_models). Spends the balance: one image is charged (the listed price is in list_models, and a higher resolution costs more). What was charged is what get_usage reports. Returns the image's URL when it is ready within wait_seconds, otherwise a task id to follow with get_task. Sending it twice makes and charges two images, unless the second call carries the first one's idempotency_key.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Shape of the image: a size such as "1536x1024" or a ratio such as "16:9", which the API turns into a shape the model takes; square when left out. | |
| model | Yes | A model id from list_models with endpoint image. | |
| prompt | Yes | What the image should show. | |
| resolution | No | Resolution tier on a model priced by resolution: one of the ids list_models gives under `tiers`, e.g. "2K". It sets the price. A resolution for a model priced by render speed is refused before anything is sent, and a value that is none of the model's tiers by the API, with a 400 that lists them; neither is charged. | |
| wait_seconds | No | How long to wait for the result before returning, in seconds (0 to 45, default 40). An unfinished task is returned with its id. | |
| idempotency_key | No | Any string of your own, 128 characters at most. Calling again with the same one and the same arguments returns the task that call started instead of starting, and charging, another. A key stands for one request for as long as the API keeps its task: the API refuses it for a request on another tool, for another model or with other arguments, so use a new one for each new request. When left out, one is made and given back in the answer. | |
| rendering_speed | No | Render-speed tier on a model priced by it: one of the ids list_models gives under `tiers`, e.g. "TURBO". It sets the price, like resolution. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Task id: img_… (image), vid_… (video) or msc_… (music). | |
| kind | Yes | ||
| urls | Yes | Result files once completed: the images, the video, or the audio of each track. | |
| error | Yes | ||
| model | Yes | ||
| status | Yes | queued, in_progress, completed or failed. Anything else is a task that is not finished. | |
| tracks | No | Music only: one entry for each track. | |
| stalled | Yes | true when the task has gone longer than expected without finishing. | |
| archived | Yes | true: every URL in `urls` is Kunavo's own copy and does not expire. false: a file could not be archived and its URL is the model provider's temporary one. null until completed. | |
| next_step | Yes | What to do with this result. | |
| created_at | Yes | ||
| resolution | No | Video only. | |
| completed_at | Yes | ||
| pollable_until | Yes | The task can be read with get_task at least until then. | |
| idempotency_key | No | The key this task was started under, in the answer of the tool that started it (get_task does not know it). Calling that tool again with it and the same arguments returns this task. | |
| duration_seconds | No | Video only. |