Generate or edit an image (billable)
generate_imageCreates an approved, paid image generation or edit task using a selected model and budget, returning a task to poll when async.
Instructions
BILLABLE: creates a paid image task charged to the user's APIKO balance. Only call after estimate_cost on the same input and the user's explicit approval of the model and cost. With reference images in input.images it edits (POST /v1/images/edits), otherwise it generates. The input is validated against the model schema first. Runs async when the model supports it and waits up to wait_seconds; if not done, poll with get_task. Never call again to check progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | Model request fields exactly as listed in get_model input_schema (e.g. {"prompt": "...", "resolution": "2k"}). Leave out model and async. | |
| model | Yes | Exact image model id. | |
| prompt | No | Shortcut for input.prompt; give the prompt once. | |
| max_cost_usd | No | Budget the user approved; the call is refused if the estimate (or its upper bound) is higher or cannot be computed. | |
| wait_seconds | No | Seconds to wait for the result (default 30). | |
| client_request_id | No | Your id for this one approved request (8-96 chars of letters, digits, . _ -). Reusing it with the same input returns the earlier task instead of charging twice. |