# x402engine Face Swap

> x402engine Face Swap is a paid API for AI agents from x402engine.app, paid per call via x402, $0.08/call, status unknown (last checked 2026-10-18).

Swaps a face from a reference image into an AI-generated scene described by a text prompt, returning a new composited image

## Facts

- Endpoint: POST https://x402engine.app/api/image/face-swap?utm_source=zero.xyz
- Price: $0.08/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402engine-face-swap-bc24caea
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dIYlzib9L5RClXpje_mo2

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 x402engine-face-swap-bc24caea -d '<json body>'
```

Example prompt: Take the face from this photo (https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=1024) and generate a studio portrait with natural skin tones and soft cinematic lighting — avoid blur or warped eyes, output at 1024x1024, and set id_weight to 1.2 to strongly preserve the identity.

## When to prefer this

Choose this endpoint when you need to place a specific real person's face into an AI-generated scene and require prompt-controlled scene description alongside identity preservation. It is distinct from simple background replacement or inpainting — it combines text-guided image generation with face identity transfer in one call. Prefer this over generic image generation when the output must preserve a recognizable likeness.

## Known failure modes

- Reference image URL is inaccessible or returns 404 — face cannot be extracted
- No detectable face in the reference image — swap fails or returns distorted output
- Prompt conflicts with identity preservation causing uncanny or blended output
- Width or height outside 256-2048 range causes validation error
- Payment failure or insufficient USDC balance blocks the request with HTTP 402
- High id_weight combined with complex scene prompt may produce artifacts

## How this service works

125 production APIs behind HTTP 402 micropayments. 87 LLMs, Kling V3 and Hailuo video generation, image generation, code execution, travel search, web scraping, TTS, and transaction simulation. Pay with USDC on Base, USDm on MegaETH, or USDC on Solana.

## Output

Returns a generated image (likely as a URL or base64-encoded data) where the face from the reference image has been composited into the scene described by the prompt, rendered at the specified dimensions with identity preservation controlled by id_weight.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "prompt",
      "reference_image_url"
     ],
     "properties": {
      "seed": {
       "type": "number",
       "example": 7,
       "description": "Random seed for reproducibility"
      },
      "width": {
       "type": "number",
       "default": 1024,
       "example": 1024,
       "description": "Image width in pixels (256-2048)"
      },
      "height": {
       "type": "number",
       "default": 1024,
       "example": 1024,
       "description": "Image height in pixels (256-2048)"
      },
      "prompt": {
       "type": "string",
       "example": "a studio portrait with natural skin tones and soft cinematic lighting",
       "description": "Describe the final image after the face swap"
      },
      "id_weight": {
       "type": "number",
       "example": 1.2,
       "description": "How strongly to preserve identity from the reference face"
      },
      "guidance_scale": {
       "type": "number",
       "example": 4,
       "description": "Prompt guidance strength"
      },
      "negative_prompt": {
       "type": "string",
       "example": "blur, warped eyes, extra fingers",
       "description": "What to avoid in the final image"
      },
      "reference_image_url": {
       "type": "string",
       "example": "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=1024",
       "description": "Public image URL containing the source face to preserve"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402engine-face-swap-bc24caea/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402engine.app](https://www.zero.xyz/host/x402engine.app/llms.txt)
