generate_image
Generate image(s) from a text prompt, optionally with reference images (editing / image-to-image). Waits briefly for completion and usually returns the finished image inline (URL + small preview). Cost in credits is returned.
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": {
"prompt": "<prompt>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Fixes randomness. Only for models that declare seed (see get_model); a model known not to apply it — including the default image model — rejects the call. For distinct variants use num_images, or separate calls with a different idempotency_key each — identical calls within ~20s are de-duplicated to one generation. | |
| input | No | Model-specific parameters from get_model input_schema.parameters, keyed by parameter name and merged with the fields above. Some of them (e.g. quality, image_size, image_resolution) change the cost of the call — get_model shows the reference pricing. A misspelled name, or a parameter this model is known not to apply, is rejected before the generation starts; the error lists the parameters the model declares. | |
| model | No | Model slug from list_models (slugs may contain '/', e.g. 'google/imagen4' — pass verbatim). Omit to use the default image model. | |
| prompt | Yes | What to generate. Russian or English. | |
| image_urls | No | Public https URLs of reference images for editing / image-to-image, or several (2–10, model-dependent) to merge subjects, products and styles into one image. | |
| num_images | No | How many images to generate in ONE call (model-dependent). Prefer this for multiple variants of a prompt — they come back together as a single tiled result. For variants via separate calls, pass a different idempotency_key each. | |
| resolution | No | Output resolution, e.g. '1K', '2K', '4K'. Only for models that declare resolution (see get_model). | |
| aspect_ratio | No | Aspect ratio, e.g. '1:1', '16:9', '9:16', '4:3', '3:4'. Model-dependent. | |
| wait_seconds | No | How long to wait inline for completion before returning a request_id. | |
| idempotency_key | No | Optional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse. | |
| include_preview | No | Attach a small inline preview of the finished image to the result. | |
| negative_prompt | No | What to avoid. Only for models that declare negative_prompt (see get_model); a model known not to apply it rejects the call. |