{"uid":"cap_ZOZ_A12xOZKq5BoyVmPvs","slug":"grok-image-generation-via-locus-x402-2cc89da2","name":"Grok Image Generation via Locus x402","description":"Locus public pay-per-use API","url":"https://grok.x402.paywithlocus.com/grok/image-generate","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"number"},"model":{"type":"string"},"prompt":{"type":"string"},"resolution":{"type":"string"},"aspect_ratio":{"type":"string"},"response_format":{"type":"string"}}},"responseSchema":{"type":"json","example":{"data":{},"payment":{"scheme":"exact","settledUsdc":"0.001000","authorizedMaxUsdc":"0.001000"},"request":{"id":"00000000-0000-4000-8000-000000000000","statusUrl":"/requests/00000000-0000-4000-8000-000000000000"},"success":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GF2fcq1WROEWL4ZAHaOWa","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","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 xAI's Grok image models, with configurable resolution, aspect ratio, and output format, paid via x402 micropayment.","exampleAgentPrompt":"Use Grok to generate a single 2k resolution 16:9 landscape image of a futuristic city at sunset with neon lights, using the grok-imagine-image-quality model, and return the image URL.","exampleUseCases":[{"title":"High-res concept art for product pitch","prompt":"Generate a 2k resolution 4:3 image of a sleek electric sports car in a minimalist showroom using grok-imagine-image-quality, and give me back the URL."},{"title":"Square social media post image","prompt":"Create a square 1:1 image of a cozy autumn coffee shop with warm lighting and falling leaves outside the window using the grok-imagine-image model at 1k resolution."},{"title":"Batch portrait images for story characters","prompt":"Generate 3 portrait-style (9:16) character images of a medieval knight, a roguish thief, and a wise wizard for my fantasy story, using grok-imagine-image at 1k resolution, and return the URLs."}],"resultDescription":"Returns a JSON object containing a `data` field with the generated image (as a URL or base64-encoded string depending on response_format), a `payment` object confirming 0.001 USDC was settled, a `request` object with a unique request ID and status URL for tracking, and a `success` boolean.","failureModes":["Invalid or missing prompt — returns error, no image generated","Unsupported model ID — must be 'grok-imagine-image' or 'grok-imagine-image-quality'","Unsupported resolution value — only '1k' or '2k' accepted","Invalid aspect ratio string — must match accepted formats like '1:1', '16:9', etc.","Payment failure — x402 payment not authorized or USDC balance insufficient","Request timeout — image generation exceeds processing window","n exceeds allowed batch limit — too many images requested at once"],"whenToPreferThis":"Choose this endpoint when you need AI image generation powered by xAI's Grok models specifically, want micropayment-based pay-per-call pricing via x402 (no subscription required), need control over resolution (1k/2k), aspect ratio, and output format (URL vs base64), or are building an agent pipeline that integrates Coinbase-compatible x402 payments natively.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:37:06.613Z","isFirstParty":false}