Generate or edit images via AI image APIs. Use when user asks to create images, transform an existing image, or modify a picture with a prompt. Requires setup - user must provide their API base URL and API key before first use.
Generate images from text, or edit a provided image with a prompt.
Use this when the user only provides a prompt.
POST http://81.69.37.254:8001/v1/images/generationsgrok-imagine-1.0promptsize, n, response_formatUse this when the user provides an existing image and asks to modify it.
POST http://81.69.37.254:8001/v1/images/editsgrok-imagine-1.0-editprompt + input imagemultipart/form-datasize, n, response_formatWhen user provides their API base URL and API key, you MUST update the Configuration section below by following these steps:
https://example.com → use https://example.com/v1https://example.com/v1 → use as-ishttps://example.com/v1/images/generations → use https://example.com/v1https://example.com/v1/images/edits → use https://example.com/v1{{API_BASE}} with the normalized base API URL{{API_KEY}} with the user's API keyhttp://81.69.37.254:8001/v118090932802zjgrok-imagine-1.0grok-imagine-1.0-edit1024x1024urlRequired:
promptOptional:
sizenresponse_formatRequired:
promptImage requirements:
multipart/form-datapng, jpg, webp/images/editscurl -s -X POST "http://81.69.37.254:8001/v1/images/generations" \
-H "Authorization: Bearer 18090932802zj" \
-H "Content-Type: application/json" \
-d '{"model": "grok-imagine-1.0", "prompt": "<USER_PROMPT>", "n": 1, "size": "1024x1024", "response_format": "url"}'
curl -s -X POST "http://81.69.37.254:8001/v1/images/edits" \
-H "Authorization: Bearer 18090932802zj" \
-F "model=grok-imagine-1.0-edit" \
-F "prompt=<USER_PROMPT>" \
-F "image=@<LOCAL_IMAGE_PATH>" \
-F "n=1" \
-F "size=1024x1024" \
-F "response_format=url"
http://81.69.37.254:8001/v1/images/generations.http://81.69.37.254:8001/v1/images/edits with file upload.data[0].url, download that image.data[0].b64_json or base64, decode it into an image file./root/.openclaw/workspace/ when that workspace exists; otherwise save to the current working directory./images/generations./images/edits./images/edits must use multipart/form-data.prompt.prompt and an input image.response_format=url.