{"uid":"cap_diZ5-vJOLrt5gPg_kUzoq","slug":"agentutility-image-inpainting-6186d6ec","name":"AgentUtility Image Inpainting","description":"Inpaints an image by replacing the masked region with content matching a text prompt. White pixels in the mask = region to inpaint. Default model: gpt-image-2. Returns a permanent fal-hosted PNG URL. Use it for mask-based image edits, object replacement, mask-driven face swap, or generative fill.","url":"https://x402.agentutility.ai/image-inpaint","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"required":["image_url","mask_url","prompt"],"properties":{"model":{"type":"string","description":"Override the inpaint model. Default 'gpt-image-2'."},"prompt":{"type":"string","description":"What to fill the masked region with."},"mask_url":{"type":"string","description":"Public http(s) URL of the mask image (white = inpaint region; black = keep)."},"image_url":{"type":"string","description":"Public http(s) URL of the source image."}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"model":{"type":"string"},"prompt":{"type":"string"},"source":{"type":"string"},"image_url":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"model":"fal-ai/inpaint","prompt":"a golden retriever sitting on a bench","source":"fal","image_url":"https://v3.fal.media/files/abc/xyz/inpainted.png"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_LWeODzpimXrfaLEmEariW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Inpaints an image by replacing a masked region with AI-generated content guided by a text prompt, returning a permanent PNG URL.","exampleAgentPrompt":"Take this product photo at https://example.com/photo.jpg, use the white-masked region in https://example.com/mask.png to remove the old background, and fill it with a bright studio white background using the gpt-image-2 model.","exampleUseCases":[{"title":"Object removal with generative fill","prompt":"I have a photo at https://example.com/street.jpg and a mask at https://example.com/mask.png that covers a parked car. Replace the masked car area with a natural continuation of the sidewalk and street."},{"title":"Product image background swap","prompt":"Here's my product shot at https://cdn.shop.com/item.jpg — use the mask at https://cdn.shop.com/mask.png to replace the cluttered background with a clean white studio backdrop."},{"title":"Mask-driven face swap in portrait","prompt":"I want to swap the face in this portrait https://example.com/portrait.jpg using the mask at https://example.com/face_mask.png — fill the masked area with a smiling young woman with brown hair."}],"resultDescription":"A JSON response containing a permanent fal-hosted PNG image URL of the inpainted result, where the masked region has been replaced with AI-generated content matching the text prompt.","failureModes":["Invalid or inaccessible image/mask URL returns an error","Mask dimensions mismatch with source image causes failure","Prompt too vague may produce unrealistic fill results","Payment failure via x402/USDC results in 402 response","Unsupported image format for source or mask","Rate limits or model unavailability from underlying fal.ai provider"],"whenToPreferThis":"Choose this endpoint when you need mask-driven, region-specific image editing with a text prompt — especially object removal, background replacement, face swap, or generative fill. It is ideal when you have a pre-computed binary mask and want precise control over which pixels are regenerated. Prefer it over full image generation when you want to preserve the unmasked portions of the original image exactly.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:43:05.810Z","isFirstParty":false}