AI Utilities

AI IMAGE GENERATION — POST {prompt} and get back a PNG, base64 in JSON (?raw=1 for raw bytes)

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.

Price: $0.07 per call, paid in USDC via the x402 protocol (see the x402 security scheme).

post/api/generate-image

Request

  • Base URL: https://api.webbersites.com
  • URL: https://api.webbersites.com/api/generate-image
  • Auth: API key in header X-PAYMENT

Request body

promptstring required

What to generate, up to 2,000 chars — subject, style, composition, lighting

aspect_ratiostring

1:1 (default), 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, or 21:9

urlstring

Optional public URL of a reference image to edit/restyle instead of generating from scratch (png, jpeg, gif, webp; max 5 MB)

image_base64string

Alternative to url: a reference image as base64 (data URI accepted)

Response

Success

image_base64string

the generated image as base64 — decode and save

content_typestring
bytesnumber
modestring

generate or edit

modelstring
usageobject

Changes

No recorded changes to this operation across all 1 revision of this API.