Text to image, paid per call
Post a prompt and a model, settle the 402 in USDC, and the image comes back in the same response. 8 models, square to 21:9, up to 4K.
POST /api/x402/image · from $0.02



Try it
curl -i -X POST https://www.trezalabs.com/api/x402/image \
-H 'Content-Type: application/json' \
-d '{"prompt":"a lighthouse on a sea cliff at golden hour, soft mist, cinematic wide shot","model":"nano-banana","aspectRatio":"1:1"}'Without a payment this answers 402 Payment Required, with the price for exactly this body, the USDC token and the address to pay in the PAYMENT-REQUIRED header. Nothing is charged.
npx awal@latest x402 pay https://www.trezalabs.com/api/x402/image \
-X POST \
-d '{"prompt":"a lighthouse on a sea cliff at golden hour, soft mist, cinematic wide shot","model":"nano-banana","aspectRatio":"1:1"}' \
--max-amount 60000awal reads the 402, pays it from your agentic wallet in USDC on Base, repeats the request and prints the response. --max-amount caps the payment in USDC units of a millionth: 60,000 is $0.06, this body's price. Any other x402 client works the same way.
npx awal@latest x402 details https://www.trezalabs.com/api/x402/imagePaying for a request accepts our Terms of Service and Privacy Policy, including the usage policies of the model provider that renders it. Not sold in sanctioned regions.
Price
Quoted per request in the 402, so read it from there rather than hard-coding it. A render that fails gets a free retry.
- Google Nano Banana (Gemini 2.5 Flash Image)default
nano-banana$0.06
- Google Nano Banana 2 (Gemini 3.1 Flash Image)
nano-banana-21K $0.10 · 512 $0.07 · 2K $0.15 · 4K $0.22
- Google Nano Banana Pro (Gemini 3 Pro Image)
nano-banana-pro1K $0.20 · 2K $0.20
- OpenAI GPT Image 2.6 Flare
gpt-image-2.6medium $0.08 · low $0.05 · high $0.10 · xhigh $0.16 · max $0.36
- OpenAI GPT Image 2
gpt-image-2medium $0.10 · low $0.02 · high $0.36
- ByteDance Seedream 5.0 Pro
seedream-5-pro2K $0.13
- Black Forest Labs FLUX.2 Pro
flux-2-pro$0.07 to $0.11
- Recraft V4.1
recraft-v4.1$0.05
Limits
- prompt: up to 2,000 characters.
- Returns an image URL in the JSON response, with a statusUrl you can GET again for free.
- 60 requests per hour per IP address, before any payment is looked at.
- Paid in USDC on Base or Solana. Fields the endpoint does not read are refused before payment, not charged for and ignored.
- Aspect ratios run from 1:1 to 21:9, as each model sells them; a bare GET lists them per model.
- resolution (Nano Banana 2 and Pro, Seedream) or quality (GPT Image) is the one setting that moves the price.
- reference_image_urls: up to 4 images whose subject or style is kept (3 on Nano Banana, none on Recraft); each adds to the price, most on FLUX.2 Pro, which bills them by the megapixel.
A bare GET /api/x402/image answers with the whole menu as JSON.
{
"runId": "2026-09-23T18:04:11.000Z#1a2b3c4d",
"status": "success",
"image": "https://www.trezalabs.com/api/media/generated/x402_image/1a2b3c4d.png?s=...&c=...",
"statusUrl": "https://www.trezalabs.com/api/x402/image?runId=...&token=...",
"paidUsd": 0.06,
"model": "nano-banana",
"aspectRatio": "1:1",
"transaction": "0x..."
}The same payment buys
Video
POST /api/x402/video
A prompt or a first frame in, a clip out, on Veo 3.1, Kling 3.0, Seedance 2.5, Wan 2.7 or Hailuo 3.
From $0.28
Speech
POST /api/x402/speech
Text to an ElevenLabs voiceover, Eleven v3 or Multilingual v2, in dozens of voices.
From $0.02
Music
POST /api/x402/music
An original Google Lyria 3 track from a description: a 30-second bed or a full song.
From $0.06
Shorts
POST /api/x402/short
A topic in, a finished 30-second narrated vertical short out: scenes, voice, music, captions.
From $0.87
Listed in the Coinbase x402 Bazaar, so agents can find it with npx awal@latest x402 bazaar search "image generation". Full reference in the x402 docs and the OpenAPI spec.