post_generate_image
AI IMAGE GENERATION — POST {prompt} and get back a PNG, base64 in JSON (?raw=1 for raw bytes). Gemini 2.5 Flash Image (nano-banana): photoreal scenes, illustrations, product shots, UI mockups — renders text in images well. Optional {aspect_ratio}: 1:1 (default), 16:9, 9:16, 4:3 + 6 more. Reference images: pass {url} or {image_base64}, or up to 3 in {reference_images}, to edit, restyle, or compose ('put this product on this beach'). The x402 payment IS the auth. ($0.07 per call, paid via x402)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Optional public URL of a reference image to edit/restyle instead of generating from scratch (png, jpeg, gif, webp; max 5 MB) | |
| prompt | Yes | What to generate, up to 2,000 chars — subject, style, composition, lighting | |
| aspect_ratio | No | 1:1 (default), 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, or 21:9 | |
| image_base64 | No | Alternative to url: a reference image as base64 (data URI accepted) | |
| reference_images | No | Up to 3 reference images (URLs or base64 strings, 6 MB combined) to compose — product placement, style transfer, character consistency |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | generate or edit | |
| bytes | No | ||
| model | No | ||
| usage | No | ||
| content_type | No | ||
| image_base64 | No | the generated image as base64 — decode and save |