{"uid":"cap_hqD5IKOR23fD0jGQJ24ZN","slug":"treza-labs-image-generation-api-0e72a535","name":"Treza Labs Image Generation API","description":"Image generation: a prompt in, one image back in the same response. 7 models including Google Nano Banana and Nano Banana Pro, OpenAI GPT Image 2, Seedream 5.0 Pro and FLUX.2 Pro, square to 21:9, up to 4K, from $0.02. GET this URL for every model and price. No account or API key: the payment is the only credential.","url":"https://www.trezalabs.com/api/x402/image?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["prompt"],"properties":{"async":{"type":"boolean","default":false,"description":"true: answer 202 with a statusUrl at once."},"model":{"enum":["nano-banana","nano-banana-2","nano-banana-pro","gpt-image-2","seedream-5-pro","flux-2-pro","recraft-v4.1"],"type":"string","default":"nano-banana","description":"Prices: nano-banana $0.06; nano-banana-2 1K $0.10, 512 $0.07, 2K $0.15, 4K $0.22; nano-banana-pro 1K $0.20, 2K $0.20, 4K $0.35; gpt-image-2 medium $0.10, low $0.02, high $0.36; seedream-5-pro 2K $0.13, 1K $0.07; flux-2-pro $0.05 (1:1) to $0.09; recraft-v4.1 $0.05."},"prompt":{"type":"string","maxLength":2000,"description":"What the image should show."},"quality":{"enum":["low","medium","high"],"type":"string","description":"gpt-image-2."},"resolution":{"enum":["512","1K","2K","4K"],"type":"string","description":"nano-banana-2, nano-banana-pro, seedream-5-pro."},"aspectRatio":{"enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3","4:5","5:4","21:9"],"type":"string","default":"1:1","description":"Each model sells its own; GET this URL."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"image":"https://www.trezalabs.com/api/media/generated/x402_image/1a2b3c4d.png?s=...&c=...","model":"nano-banana","runId":"2026-09-23T18:04:11.000Z#1a2b3c4d","status":"success","paidUsd":0.06,"statusUrl":"https://www.trezalabs.com/api/x402/image?runId=...&token=...","aspectRatio":"1:1","transaction":"0x..."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.06","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.06/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.06","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.06","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MopYottKN46YJkp1EF0-Y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.06","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates a single image from a text prompt using one of 7 AI models, returning the image directly in the response with no account required.","exampleAgentPrompt":"Generate a 16:9 image of a misty mountain forest at sunrise with golden light filtering through the trees, using the nano-banana-pro model at 2K resolution.","exampleUseCases":[{"title":"E-commerce product background creation","prompt":"Create a clean, white-studio-style product image background for a pair of running shoes — square format, using gpt-image-2 at medium quality. The prompt should be: 'minimalist white studio background with soft shadow, professional product photography lighting'."},{"title":"Social media content generation","prompt":"Make a vertical 9:16 image for an Instagram story showing a cozy autumn café interior with warm lighting, wooden tables, and a steaming latte — use the recraft-v4.1 model."},{"title":"Concept art for creative project","prompt":"Generate a cinematic 21:9 image of a futuristic cyberpunk city at night with neon reflections on wet streets, using flux-2-pro model."}],"resultDescription":"A binary image file returned directly in the HTTP response body (same request, no polling needed for sync calls). The image matches the requested aspect ratio, resolution, and model. Optionally returns a 202 with a statusUrl for async mode.","failureModes":["Invalid or unsupported aspect ratio for the chosen model — returns error indicating the combination is unsupported","Prompt exceeds 2000 character limit — returns validation error","Payment insufficient for the selected model/quality/resolution tier — payment rejected before processing","Model name not recognized — enum validation error","Async mode returns 202 with statusUrl; agent must poll that URL separately"],"whenToPreferThis":"Choose this endpoint when you need a single image generated from a text prompt with no account setup, paying per image via USDC x402. It's ideal for agents that need image generation without managing API keys, want to choose from 7 distinct models (Google, OpenAI, FLUX, Seedream, Recraft) at varying price/quality tiers, or need non-standard aspect ratios up to 21:9 and resolutions up to 4K.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T12:38:09.935Z","isFirstParty":false,"canonicalSlug":"treza-labs-image-generation-api-0e72a535"}