Generate an image
generate_imageGenerate one image, or edit one, with the selected project key. Unless the user names a model, pick from list_models type=image featured=true, the curated current ones; a model's params.image (detail=full) lists sizes, aspect ratios and qualities. Waits up to about 45 seconds: status completed carries url, a download link valid for 1 hour; status processing carries id for get_media_job. The result is deleted 24 hours after the job ends (1 hour on a zero-retention project) unless store is true. Normal costs and policy checks apply; usage.cost is the charge in USD. Requires runtime:call.
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": {
"id": "<id>",
"model": "<model>",
"prompt": "<prompt>",
"uuid": "<uuid>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Runtime API key ID in this project; its secret is never returned | |
| size | No | Pixel size WxH, for models that take one. | |
| uuid | Yes | Project UUID in the authorized organization | |
| image | No | Image to edit (needs the image_edit capability). An https URL or a file_<id>. | |
| model | Yes | Image model id from list_models type=image (featured=true for the curated ones). | |
| store | No | Also save the result to the project's files and return a reusable file_id. Default false: only a temporary link. | |
| prompt | Yes | What the image shows. | |
| quality | No | A tier from params.image.qualities. | |
| parameters | No | Provider settings, forwarded verbatim. Each model lists the keys it takes in params.image.parameters (list_models detail=full). | |
| resolution | No | Output tier such as 1k or 2k, for models that declare one. | |
| aspect_ratio | No | Shape such as 16:9, from params.image.aspect_ratios. | |
| reference_images | No | Images the result draws on: subject, product or style. An https URL or a file_<id>. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| url | No | ||
| next | No | ||
| error | No | ||
| usage | No | ||
| status | Yes | ||
| file_id | No | ||
| mime_type | No | ||
| expires_at | No |