# AgentUtility Image Inpainting

> AgentUtility Image Inpainting is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-16).

Inpaints an image by replacing a masked region with AI-generated content guided by a text prompt, returning a permanent PNG URL.

## Facts

- Endpoint: POST https://x402.agentutility.ai/image-inpaint
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentutility-image-inpainting-6186d6ec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_diZ5-vJOLrt5gPg_kUzoq

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentutility-image-inpainting-6186d6ec -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "properties": {
      "image_url": {
       "type": "string",
       "description": "Public http(s) URL of the source image."
      },
      "mask_url": {
       "type": "string",
       "description": "Public http(s) URL of the mask image (white = inpaint region; black = keep)."
      },
      "prompt": {
       "type": "string",
       "description": "What to fill the masked region with."
      },
      "model": {
       "type": "string",
       "description": "Override the inpaint model. Default 'gpt-image-2'."
      }
     },
     "required": [
      "image_url",
      "mask_url",
      "prompt"
     ]
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "image_url": {
       "type": "string"
      },
      "model": {
       "type": "string"
      },
      "prompt": {
       "type": "string"
      },
      "source": {
       "type": "string"
      }
     }
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## Response schema (JSON Schema)

```json
{
 "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"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentutility-image-inpainting-6186d6ec/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
