# Stability AI Search and Replace via Locus x402

> Stability AI Search and Replace via Locus x402 is a paid API for AI agents from stability-ai.x402.paywithlocus.com, paid per call via x402, $0.057/call, status unknown (last checked 2026-09-15).

Finds a specific object in an image using a text search prompt and replaces it with a new AI-generated element described by a replacement prompt.

## Facts

- Endpoint: POST https://stability-ai.x402.paywithlocus.com/stability-ai/search-and-replace
- Price: $0.057/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stability-ai-search-and-replace-via-locus-x402-dce49738
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7DAoit3G-4GYJqoup4q_H

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 stability-ai-search-and-replace-via-locus-x402-dce49738 -d '<json body>'
```

Example prompt: In this product photo I'm sending, find the wooden table and replace it with a sleek marble countertop — output as a PNG and avoid any dark or cluttered surfaces.

## When to prefer this

Choose this endpoint when you need to semantically find and replace a specific named object within an existing image without manual masking. It is ideal for e-commerce, real estate, fashion, or product photography workflows where targeted in-image object substitution is required. Prefer this over inpainting endpoints when you want the model to automatically detect the region to edit based on a text description rather than supplying a manual mask.

## Known failure modes

- Search prompt fails to locate a recognizable object in the image, resulting in no meaningful replacement
- Source image is missing or malformed, causing a validation error
- Prompt is too vague for the model to produce a coherent replacement
- grow_mask value is too large, causing replacement to bleed into unintended areas
- Payment authorization fails, blocking the request from being processed
- Unsupported output_format value causes a format error
- Seed value produces an undesirable or unexpected result with no guarantee of determinism

## How this service works

Generative AI platform for images, 3D models, and audio — text-to-image, editing, upscaling, and more.

## Output

Returns a JSON response with a success flag, a payment settlement record showing the USDC amount paid, and a request object containing a unique request ID and a status URL for tracking the async image processing result. The actual edited image data is nested within the data field.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "seed": {
   "type": "number"
  },
  "image": {
   "type": "string"
  },
  "prompt": {
   "type": "string"
  },
  "grow_mask": {
   "type": "number"
  },
  "output_format": {
   "type": "string"
  },
  "search_prompt": {
   "type": "string"
  },
  "negative_prompt": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stability-ai-search-and-replace-via-locus-x402-dce49738/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stability-ai.x402.paywithlocus.com](https://www.zero.xyz/host/stability-ai.x402.paywithlocus.com/llms.txt)
