{"uid":"cap_-AZR1vo_923KlWeZIZnVY","slug":"openai-gpt-image-2-image-generation-x402-ff991ddb","name":"OpenAI gpt-image-2 Image Generation (x402)","description":"gpt-image-2: OpenAI GPT Image 2 image generation, paid per call in USDC. OpenAI list $30 per 1M image tokens (1024x1024: low 196, medium 1756, high 7024 tokens), text in $5 per 1M, plus $0.0005 (Base) or $0.0005 (Solana) per call. Send size and quality (auto is refused); omitted means 1024x1024 medium. Returns b64_json. Rates: https://openai.mm.family/x402/pricing","url":"https://openai.mm.family/x402/v1/models/gpt-image-2/images/generations?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"integer"},"size":{"type":"string"},"model":{"enum":["gpt-image-2"],"type":"string"},"prompt":{"type":"string"},"quality":{"enum":["low","medium","high"],"type":"string"},"background":{"type":"string"},"moderation":{"enum":["auto"],"type":"string"},"output_format":{"enum":["png","jpeg","webp"],"type":"string"}}},"responseSchema":{"type":"json","example":{"data":[{"b64_json":"<base64 png>"}],"size":"1024x1024","usage":{"input_tokens":12,"total_tokens":208,"output_tokens":196},"created":1,"quality":"low","output_format":"png"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003473","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.003473/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003473","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003473","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7rW_V0Up0pYQAGzCZexFf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003473","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates images from text prompts using OpenAI's GPT-Image-2 model, returning base64-encoded PNG/JPEG/WebP, paid per call in USDC via x402.","exampleAgentPrompt":"Generate a high-quality 1024x1024 PNG image of a cozy coffee shop interior with warm lighting and wooden furniture using GPT-Image-2, and give me the result as a base64 image.","exampleUseCases":[{"title":"Product listing image creation","prompt":"Generate a high-quality PNG image of a sleek wireless Bluetooth headphone on a white background at 1024x1024 using GPT-Image-2 — I need it for my e-commerce listing."},{"title":"Low-cost thumbnail generation","prompt":"Create a low-quality 1024x1024 JPEG image of a mountain sunset for a blog post thumbnail using GPT-Image-2 — keep costs minimal."},{"title":"Marketing visual for social media","prompt":"Use GPT-Image-2 to generate a medium-quality WebP image of a vibrant farmers market scene with colorful produce stands for our Instagram campaign."}],"resultDescription":"Returns a JSON object containing an array of image objects each with a b64_json field holding the base64-encoded image, along with metadata including size, quality, output_format, creation timestamp, and token usage (input_tokens, output_tokens, total_tokens).","failureModes":["Prompt refused by content moderation — returns error if prompt violates OpenAI content policy","'auto' quality value rejected — endpoint explicitly refuses 'auto'; must specify low, medium, or high","Payment failure — x402 payment not accepted or USDC balance insufficient","Invalid size or format combination — unsupported size strings return validation errors","Missing prompt — request without a prompt field returns 400 bad request","Rate limiting — too many concurrent requests may result in 429 errors"],"whenToPreferThis":"Choose this endpoint when you need programmatic access to OpenAI's GPT-Image-2 model with pay-per-call USDC micropayments via x402 protocol, without needing a traditional OpenAI API key or subscription. Ideal for agents that require fine-grained cost control per image (billing in USDC per call), or for blockchain-native / crypto-native workflows. Prefer this over general OpenAI image endpoints when operating in an agentic payment context and when you need explicit quality control (low/medium/high) with predictable per-token pricing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:42:09.845Z","isFirstParty":false,"canonicalSlug":"openai-gpt-image-2-image-generation-x402-ff991ddb"}