# imagegen.coinopai.com > AI image generation API. Pay per image via x402 on Base mainnet. ## Endpoints GET /prompt-styles ($0.005) - Image prompt styles for FLUX text-to-image: 12 prompt templates with a {subject} slot (editorial tech, product shot, flat icon, isometric and more), each with name, best_for and template. No parameters. Returns static JSON with count, styles, aspect_guide and tier_guide in milliseconds. Use it to write a stronger image generation prompt and pick a tier before calling /generate. - Curated FLUX prompt style recipes, aspect guide, tier picker. No params, static, instant. GET /generate?prompt={text}&aspect={ratio} - Image generation: text prompt to image (text-to-image) with FLUX Schnell. Pass prompt and optional aspect (1:1, 16:9, 9:16 or 4:3). Returns JSON in one synchronous call with image_url (link to the generated image), prompt, aspect, model and generated_at. Use it for illustrations, thumbnails, mockups, concept art and social media images. No API key or signup. - Requires x402 payment: 0.05 USDC on Base (eip155:8453) - Tier: standard - Returns: {"image_url":"...","prompt":"...","aspect":"...","generated_at":"..."} - aspect options: 1:1 (default, 1024x1024), 16:9 (1024x576), 9:16 (576x1024), 4:3 (1024x768) GET /generate/clean?prompt={text}&aspect={ratio} - Image generation with transparent background: text prompt to image with FLUX Schnell, then automatic background removal. Pass prompt and optional aspect (1:1, 16:9, 9:16 or 4:3). Returns JSON in one synchronous call with image_url (link to the transparent PNG cutout), prompt, aspect, tier, model and generated_at. Use it for product cutouts, stickers, logo marks and e-commerce assets. - Requires x402 payment: 0.35 USDC on Base (eip155:8453) - Tier: clean image with background removal - Returns transparent PNG URL GET /generate/hd?prompt={text}&aspect={ratio} - High-resolution image generation: text prompt to image with FLUX 1.1 Pro plus a 4x Real-ESRGAN upscale, run as an async job. Pass prompt and optional aspect (1:1, 16:9, 9:16 or 4:3). The paid call returns HTTP 202 JSON with job_id, status, tier and a free status_url; poll it until status is succeeded, then read image_url (stored 7 days, see expires_at). If the job fails on our side, its status carries a retry_credit for one free retry. - Requires x402 payment: 0.10 USDC on Base (eip155:8453) - Tier: premium image with 4x upscale - Returns HTTP 202 with an unguessable job_id and free status_url - Poll status_url until status is succeeded or failed; image_url (stored by this service for 7 days, with expires_at) appears on success. A job that failed on our side (infrastructure or model host) carries retry_credit: resend the same route with retry_credit=&wallet= and no payment for one free retry (72 hours) GET /generate/pro?prompt={text}&aspect={ratio} - Premium image generation: text prompt to image with FLUX Kontext Max, background removal and a 4x upscale, run as an async job. Pass prompt and optional aspect (1:1, 16:9, 9:16 or 4:3). The paid call returns HTTP 202 JSON with job_id, status, tier and a free status_url; poll it until status is succeeded, then read image_url (transparent, high-resolution, stored 7 days). If the job fails on our side, its status carries a retry_credit for one free retry. - Requires x402 payment: 0.75 USDC on Base (eip155:8453) - Tier: top-tier image with background removal + 4x upscale - Returns HTTP 202 with an unguessable job_id and free status_url - Poll status_url until status is succeeded or failed; image_url (stored by this service for 7 days, with expires_at) appears on success. A job that failed on our side (infrastructure or model host) carries retry_credit: resend the same route with retry_credit=&wallet= and no payment for one free retry (72 hours) GET /presets ($0.005) - Photo transform presets: the list of 58 identity-preserving image-to-image styles used by /transform (action figure, pet royalty, CEO portrait, cartoon villain, fantasy poster, storybook hero, pet astronaut and more). No parameters. Returns static JSON with count and presets, each with id, title, tagline, input_type (person or pet) and categories, plus usage, terms and aspect_guide. - Lists the 58 identity-preserving transform presets for /transform: id, title, tagline, input_type (person | pet), categories. Static, instant. GET /transform?image_url={public https image}&preset={id}&aspect={ratio} - Photo transform (image-to-image): restyle a photo with a named preset while keeping the subject's identity (FLUX Kontext Max). Pass image_url (public https JPEG, PNG or WebP), preset (id from /presets, e.g. action-figure) and optional aspect. An unreachable or non-image URL is refused unpaid. Returns HTTP 202 JSON with job_id and a free status_url; poll until succeeded, then read image_url (stored 7 days). A job that fails on our side carries a retry_credit for one free retry. - Requires x402 payment: 0.75 USDC on Base (eip155:8453) - Image-to-image via FLUX Kontext Max: keeps the subject's face or pet, changes scene and style per preset (action-figure, pet-royal, ceo-portrait, cartoon-villain, fantasy-poster, storybook-hero, pet-astronaut, ...) - Invalid image_url / unknown preset / bad aspect return 400 BEFORE payment. After your payment is verified and BEFORE it is settled, this server reads the first bytes of image_url to confirm it is a publicly fetchable JPEG, PNG or WebP (max 20 MB); if not, 422 and nothing is charged. The model provider fetches the full file. - aspect options: match_input_image (default), 1:1, 16:9, 9:16, 4:3, 3:4 - Returns HTTP 202 with an unguessable job_id and free status_url; poll until succeeded or failed; image_url (PNG, stored by this service for 7 days, see expires_at) appears on success - Terms: submit only images you have rights to; no minors; the provider safety filter applies. If the render fails after payment because of our infrastructure or the model host, the job status carries a retry_credit: one free retry of this route (single use, 72 hours, bound to the paying wallet). An image the safety filter declines after payment earns no automatic retry; the job is logged for manual review (hello@forgemesh.io, quote the job id) - Print it: pass the result image_url to POST https://x402swag.com/api/custom/designs {image_url, product:"framed-poster", color:"Black"|"White"|"Walnut", fit:"contain"|"cover"} — framed matte poster 11x14 $59 / 12x16 $69 / 16x20 $89, x402-only checkout, buyer approves the mockup first. Use aspect=3:4 here if you plan to frame it. GET /jobs/{job_id} - Free status lookup for a paid HD, Pro or Transform job - Returns queued, processing, succeeded, or failed; no second payment required ## Rate Limits - 10 requests per minute per IP across all tiers ## Payment - Network: Base mainnet - Receiving wallet: 0x4C1a4FcE51Fea51f128a01ccE8BecB106d391155 - Facilitator: https://x402.xyz/facilitate - Live extensions: Bazaar discovery and optional payment-identifier idempotency - Signed offer/receipt extension: available when OFFER_RECEIPT_SIGNING_PRIVATE_KEY is configured - Builder code extension: configured when BUILDER_CODE is present - Sign-in-with-x: not needed for one-shot image outputs ## Use cases - Automated image generation for AI agents and bots - Bot-to-bot creative workflows - Programmatic content creation pipelines ## ForgeMesh Fleet - Paid registry: POST https://x402.forgemesh.io/fleet-products ($0.05) — id, name, host, category, route_count, price_range per product - Paid spec sheet: POST https://x402.forgemesh.io/fleet-product-detail ($0.05) — every route, method, price, input schema, worked example for one product - Free index: https://x402.forgemesh.io/llms.txt Notes for every generation route - Prompt is required: a missing or blank prompt is 400 before payment (only directory verifiers get a default image, and the response says so). - Sync routes (/generate, /generate/clean) return image_url on this service plus expires_at (7 days) and stop at 85 seconds: a render that has not finished is 504 and not charged. - If the model host is out of capacity or credit, paid routes answer 503 with Retry-After before any payment.