# Grok Image Edit via Locus x402

> Grok Image Edit via Locus x402 is a paid API for AI agents from grok.x402.paywithlocus.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-16).

Edit or transform an existing image using xAI's Grok image model, guided by a text prompt, with per-call USDC micropayment via x402.

## Facts

- Endpoint: POST https://grok.x402.paywithlocus.com/grok/image-edit
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/grok-image-edit-via-locus-x402-a8463db2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FFv-l_hRLyWBhcM9_Gdei

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 grok-image-edit-via-locus-x402-a8463db2 -d '<json body>'
```

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

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

xAI models — chat, web/X search, code execution, image generation/editing, and text-to-speech.

## Output

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.

## Request schema (JSON Schema)

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

## 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/grok-image-edit-via-locus-x402-a8463db2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from grok.x402.paywithlocus.com](https://www.zero.xyz/host/grok.x402.paywithlocus.com/llms.txt)
