{"uid":"cap_FFv-l_hRLyWBhcM9_Gdei","slug":"grok-image-edit-via-locus-x402-a8463db2","name":"Grok Image Edit via Locus x402","description":"xAI models — chat, web/X search, code execution, image generation/editing, and text-to-speech.","url":"https://grok.x402.paywithlocus.com/grok/image-edit","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"number"},"image":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}},"additionalProperties":true},"model":{"type":"string"},"prompt":{"type":"string"},"resolution":{"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_NSh-a1Ui743IEeMKHGjmT","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":"Edit or transform an existing image using xAI's Grok image model, guided by a text prompt, with per-call USDC micropayment via x402.","exampleAgentPrompt":"Take this product photo at https://example.com/shoe.jpg and add a grassy outdoor background to it — use the grok-imagine-image model at 1k resolution and give me back the URL of the edited image.","exampleUseCases":[{"title":"Add accessory to portrait photo","prompt":"Here's a headshot of me at https://example.com/headshot.jpg — can you use the Grok image editor to add a stylish hat to my head and return the edited image URL? Use the standard 1k resolution."},{"title":"Swap product photo background","prompt":"I have a product image at https://example.com/mug.jpg and I need the background replaced with a cozy coffee-shop setting. Use grok-imagine-image at 1k resolution and give me the result as a URL."},{"title":"High-res creative image transformation","prompt":"Take the image at https://example.com/cityscape.jpg and apply a painterly watercolor art style to the whole thing. Use grok-imagine-image-quality at 2k resolution and return the base64 result."}],"resultDescription":"A JSON object containing a 'data' field with the edited image (as a URL or base64 string depending on response_format), a 'payment' object confirming 0.001 USDC was settled, a 'request' object with a unique ID and status URL for polling, and a 'success' boolean.","failureModes":["Invalid or inaccessible source image URL returns an error","Unsupported model ID causes a validation failure","Insufficient USDC balance or failed x402 payment results in 402 Payment Required","Prompt too vague or empty may produce unexpected edits or an error","Resolution value outside '1k'/'2k' enum causes a bad request","Base64 image data that is malformed or too large may be rejected"],"whenToPreferThis":"Choose this endpoint when you need to modify or transform an existing image using a natural-language prompt, rather than generating an image from scratch. It is backed by xAI's Grok image models and billed per-call in USDC via x402, making it suitable for agents that need pay-as-you-go image editing without subscription overhead. Prefer the 'grok-imagine-image-quality' model and '2k' resolution when output fidelity matters, and the default 'grok-imagine-image' at '1k' for faster, cheaper edits.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T20:17:38.417Z","isFirstParty":false}