{"uid":"cap_5EjjnO_sVbYX4lWcNJ-t3","slug":"grok-image-generate-19246339","name":"Grok Image Generate","description":"Generate images from text prompts using Grok Imagine models.","url":"https://grok.mpp.paywithlocus.com/grok/image-generate?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["prompt","model"],"properties":{"n":{"type":"number","description":"Number of images to generate (default 1)"},"model":{"type":"string","description":"Metered x402 image model ID: 'grok-imagine-image-2.0', 'grok-imagine-image', or 'grok-imagine-image-quality'"},"prompt":{"type":"string","description":"Text description of the image to generate"},"resolution":{"type":"string","description":"Output resolution: '1k' (default) or '2k'"},"aspect_ratio":{"type":"string","description":"Aspect ratio (e.g. '1:1', '16:9', '9:16', '4:3', '3:2', 'auto')"},"response_format":{"type":"string","description":"Response format: 'url' (default, temporary hosted URL) or 'b64_json' (image bytes retained in the customer response artifact)."}},"additionalProperties":true},"responseSchema":null,"example":{"request":{"n":1,"model":"grok-imagine-image","prompt":"A serene landscape with rolling green hills and a clear blue sky","aspect_ratio":"16:9","response_format":"url"},"response":{"data":{"data":[{"url":"https://imgen.x.ai/xai-imgen/xai-tmp-imgen-fb12beee-184f-464a-b860-05c8fe8ed0ac.jpeg","mime_type":"image/jpeg"}],"usage":{"cost_in_usd_ticks":200000000}},"success":true}},"exampleRequest":{"n":1,"model":"grok-imagine-image","prompt":"A serene landscape with rolling green hills and a clear blue sky","aspect_ratio":"16:9","response_format":"url"},"tags":["llm","chat","x-search","web-search","image-generation","tts","ai"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":true,"priceHint":"$0.02–$0.08 per image","priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":2,"rating":{"score":"0.50","successRate":"0.00","reviews":2,"stars":"3.0","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"dynamic","summary":"$0.02–$0.08 per image (dynamic)","primary":{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xfTAkAS9BFjcHGkoQkTZj","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x20c000000000000000000000b9537d11c60e8b50","unit":"request","depositMicros":null,"planRef":null}],"brandName":"Grok","brandSlug":"grok","brandBaseUrl":"https://x.ai","brandDocsUrl":"https://docs.x.ai","whatItDoes":"Generates images from a text prompt using xAI's Grok image models, returning URLs or base64-encoded image data","exampleAgentPrompt":"Generate a photorealistic image of a golden retriever running on a sunlit beach at sunset using Grok's pro image model, in 16:9 aspect ratio, and give me back a URL.","exampleUseCases":null,"resultDescription":"Returns one or more generated images, either as publicly accessible URLs or base64-encoded JSON blobs, depending on the requested response_format. Each image corresponds to the submitted text prompt.","failureModes":["Missing required 'prompt' field returns a validation error","Invalid model ID returns an error indicating unsupported model","Unsupported aspect ratio value may return a bad request error","Exceeding allowed value for 'n' may result in an error","Network or service unavailability returns a 5xx error","Prompt violates content policy and is rejected"],"whenToPreferThis":"Choose this endpoint when you need to generate brand-new images from a text description using xAI's Grok image models. Prefer the 'grok-imagine-image-pro' model for higher quality outputs. Use this over image editing endpoints when no base image is needed — pure text-to-image generation. Ideal for creative, visual, or illustrative content generation tasks within the xAI/Grok ecosystem.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":6,"lastUsedAt":"2026-06-16T18:15:57.437Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T06:32:46.021Z","isFirstParty":false,"canonicalSlug":"grok-image-generate-19246339"}