{"uid":"cap_XXPk1ut_kTGSloSrM63YI","slug":"image-withzero-xyz-xai-grok-imagine-image-generation-5c994abc","name":"xAI Grok Imagine Image Generation","description":"Generate images from a text prompt with xAI's Grok Imagine quality tier. Returns hosted image URLs.","url":"https://image.withzero.xyz/api/v1/images/grok-imagine","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","example":{"count":1,"prompt":"A watercolor painting of a lighthouse at sunrise"},"required":["prompt","count"],"properties":{"count":{"type":"integer","default":1,"maximum":4,"minimum":1,"description":"How many images to generate (1–4)."},"prompt":{"type":"string","maxLength":4000,"minLength":1,"description":"Text description of the image to generate."}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["images","model","price_usdc"],"properties":{"model":{"type":"string","description":"The model that produced the images."},"images":{"type":"array","items":{"type":"object","required":["url","mimeType","sizeBytes"],"properties":{"url":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"}},"additionalProperties":false},"description":"The generated images, as hosted URLs."},"price_usdc":{"type":"string","description":"The amount charged for this request, in USDC."}},"additionalProperties":false},"example":{"request":{"count":1,"prompt":"A serene mountain landscape with snow-capped peaks, a crystal-clear alpine lake reflecting the peaks, and golden hour sunlight"},"response":{"model":"x-ai/grok-imagine-image-quality","images":[{"url":"https://storage.googleapis.com/withzero/image/38ec0adb-3b55-455e-bbc9-e9df71e19567.jpg","mimeType":"image/jpeg","sizeBytes":377768}],"price_usdc":"0.05"}},"exampleRequest":{"count":1,"prompt":"A serene mountain landscape with snow-capped peaks, a crystal-clear alpine lake reflecting the peaks, and golden hour sunlight"},"tags":[],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.05/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_vl_Cg43oYzLaqEvgkCIOT","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":"image.grok-imagine:1"}],"brandName":"image.withzero.xyz","brandSlug":"image-withzero-xyz-mpp","brandBaseUrl":"https://image.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Generates 1–4 images from a text prompt using xAI's Grok Imagine model, returning hosted image URLs.","exampleAgentPrompt":"Use Grok Imagine to generate 3 images of a futuristic city skyline at sunset with neon lights reflecting off rain-soaked streets.","exampleUseCases":null,"resultDescription":"An array of 1–4 generated image objects, each containing a hosted URL, MIME type, and file size in bytes. Also returns the model name used and the USDC price charged for the request.","failureModes":["Prompt exceeds 4000 character limit — request rejected with validation error","Count outside 1–4 range — request rejected","Prompt is empty or missing — required field validation error","xAI model unavailability or upstream timeout — service error response","Content policy violation on the prompt — request blocked or rejected"],"whenToPreferThis":"Choose this endpoint when you specifically want xAI's Grok Imagine model for image generation, particularly if you prefer Grok's visual style or are comparing outputs across providers. Use it over the OpenAI or Google alternatives when Grok's aesthetic or model provenance matters to the use case.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":3,"lastUsedAt":"2026-07-29T00:21:21.493Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:39:41.517Z","isFirstParty":true}