Generate Image
generate_imageTurn text prompts into PNG/JPG images via Kenari Media API, save them to your output directory, and get absolute file paths while managing per-image IDR costs.
Instructions
Generate image(s) via POST /v1/images/generations. Saves PNG/JPG to KENARI_OUTPUT_DIR and returns absolute path(s). Costs IDR per image — check list_media_models first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | How many images to generate (integer >= 1). Defaults to 1. Capped by KENARI_MAX_IMAGE_N (default 4). Each image costs IDR. | |
| size | No | Image dimensions, e.g. '1024x1024'. Optional and model-dependent. | |
| model | Yes | Kenari image model id, e.g. 'gpt-image-2'. Call list_media_models first for exact ids and per-image IDR costs. | |
| prompt | Yes | What to generate. Be specific and descriptive for best results. | |
| preview | No | Request lower-quality previews. Files are still saved and no base64 is returned. Does NOT reduce Kenari cost. | |
| background | No | Background handling: 'transparent', 'opaque', or 'auto'. Optional; not all models support transparency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Kenari video job id, when relevant to the result or error. | |
| op | No | Tool operation name the error occurred in. | |
| code | No | Machine-readable code: an error code (e.g. unauthorized, bad_request, upstream_error) or a state marker (e.g. rendering, done, still_rendering). | |
| hint | No | Human-readable remediation hint (e.g. set KENARI_API_KEY). | |
| count | No | Number of images saved. | |
| model | No | Kenari image model id used. | |
| paths | No | Absolute local paths of the saved image files under KENARI_OUTPUT_DIR. | |
| status | No | HTTP status number (on API errors) or the Kenari job status string (on video status results). | |
| disabled | No | True when video tools are disabled via KENARI_ALLOW_VIDEO=0. |