The job
An agent mid-run needs an image from a text prompt. It doesn't know yet whether it'll need this again tomorrow, or ever.
Key + invoice, the traditional shape
OpenAI's Images API, Stability AI's Stable Image API, and Replicate's hosted model endpoints all follow the same pattern: create an account, generate an API key, store it somewhere the agent can read it, and get billed on a recurring cycle, sometimes per-call against a prepaid balance, sometimes a flat monthly charge regardless of how many calls actually happened.
That's a reasonable shape for a service that generates images constantly. It's friction for an agent that wants to try a prompt once, or that's spinning up a sub-task and shouldn't be handed a long-lived vendor credential to do it.
Pay-per-call, the x402 shape
Three tiers, priced by model quality:
image-generate, $0.01. Tiers:fast(z-image-turbo, default),creative(chroma),anime(wai-Illustrious),sd35(venice-sd35). Returns a hosted PNG URL plus the resolved model, final dimensions, prompt, seed, and request timing.image-generate-pro, $0.06. Tiers:balanced(flux-2-pro, default),recraft(recraft-v4),seedream(seedream-v4),grok(grok-imagine-image),qwen(qwen-image).image-generate-ultra, $0.22. Tiers:nano-banana(nano-banana-pro, Google Gemini Image 3, default),nano-banana-2,nano-banana-lite,grok-sota.
No signup. The x402 402 response quotes the exact price before the agent's wallet pays it, and settlement is USDC on Base per call, not a running balance, not a monthly bill.
curl -X POST https://x402.agentutility.ai/image-generate \
-H "Content-Type: application/json" \
-d '{"prompt": "a red bicycle leaning against a brick wall, overcast light", "tier": "creative"}'
The first response is a 402 with the price in the payment-required header. Pay it, resend with the payment attached, get the image URL back.
The same call from MCP
If the agent already uses MCP, run the Synthforge server instead of wiring a
fetch client. Add this server to the agent's MCP configuration, restart it,
and call image-generate with the same prompt, width, height, tier,
and optional seed fields shown above.
{
"mcpServers": {
"agentutility-synthforge": {
"command": "npx",
"args": ["-y", "@agentutility/mcp-synthforge"],
"env": { "X402_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY_HEX" }
}
}
}
The tool returns the same hosted PNG URL, resolved model, canvas, and seed. Keep those fields with the brief before making the next paid call.
A sane repeat-call default
Keep routine calls on tier: "fast". Move to creative for a stylized campaign image, anime for illustration, or sd35 for a Stable Diffusion-style result. If a workflow needs a controlled retry, send a seed and record the returned seed with the prompt and dimensions. The response tells the caller which model actually rendered the image, so a later run can compare like with like.
A repeatable image recipe
For a follow-up image in the same series, keep the canvas, tier, and seed fixed. Change only the subject or scene detail in the prompt. That gives the agent a clean baseline instead of quietly changing the model or framing on every call.
{
"prompt": "Editorial product photo of a matte black smart notebook on a pale stone desk, soft window light",
"width": 1024,
"height": 1024,
"tier": "fast",
"seed": 184729
}
Save image_url, model, width, height, and seed from the paid response. On the next call, reuse the last four fields and edit the prompt. If the task changes from a quick draft to a stylized campaign image, switch to creative deliberately and treat that as a new baseline.
A repeat-call rule that won't surprise the next run
Use tier for a series, not model. A tier is the stable routing choice this endpoint publishes. Keep fast for routine drafts and creative for a campaign sequence. Send the returned seed again when you want the closest continuation, but keep the saved response as the record of what actually ran. The response's model, dimensions, and seed are the facts to carry forward.
Don't change a tier and a seed in the same retry. If a fast result misses the brief, make one prompt-only retry first. If the job needs a different look, move to creative and start a separate series. That makes paid retries legible to the agent that has to choose the next call.
Pick the next paid call by the deliverable
Don't send a finished-asset job back through a raw prompt-to-PNG call. Keep
using image-generate when the next decision is still about the picture. Move
to the endpoint that returns the thing the workflow needs next.
| The next deliverable | Route | What comes back |
| --- | --- | --- |
| Another controlled draft | image-generate at $0.01 | A new hosted PNG. Reuse the prior width, height, tier, and seed; change the prompt detail under review. |
| A caption in another language | image-generate-localize at $0.04 | A hosted image plus the original and localized caption. Send prompt, target_language, and an optional separate caption. |
| A post ready to publish | social-image-pack at $0.04 | An image sized for the requested platform, a caption, and keyword ideas from the same brief. |
| A product cutout | image-asset-pipeline at $0.08 | A generated image, upscale stage, and transparent-background stage. Each optional finishing stage can fall back to the prior image. |
The four routes have different outputs and prices. Pick one before paying, then save the response fields that matter to that route. A controlled draft keeps its seed. A social package keeps its platform and caption. A product asset keeps the selected stage URL.
Tradeoffs, honestly
- Volume favors the account. A product that renders thousands of images a day on a negotiated per-call rate will usually beat $0.01-$0.22 per call on unit cost, and the vendor relationship gives you support and SLAs an anonymous paid call doesn't.
- Model choice is bounded on both sides. We carry z-image-turbo through nano-banana-pro across the three tiers. If the job needs a specific house-tuned model or a fine-tune we don't host, the account-based route is the only route.
- x402 wins on the first call, not the thousandth. An agent that's never generated an image before, a one-off script, a sub-agent spun up for a single task: none of them want to hold a vendor API key for a call they'll make once. x402 removes the account step entirely.
- Price visibility is different in kind. A key-and-invoice API tells you the price in documentation you read beforehand and reconciles it on a bill you see later. x402 puts the price in the response to the actual request, at the moment the agent decides whether to pay it.
When the workflow needs more than an image
image-generate-localize (compose cluster, $0.04) runs image-generate and translate behind one call, returning the generated image plus a caption already translated into the target language, the pairing agents were already doing as two separate calls, collapsed into one.
Bottom line
Use a traditional account-based image API when the volume is high and predictable and the vendor relationship matters. Use image-generate (or its -pro / -ultra tiers) when the call is occasional, the agent shouldn't hold a stored key, or the price needs to be visible in the response instead of on next month's invoice.