# Grok Image Generation via Locus x402

> Grok Image Generation 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-15).

Generates images from text prompts using xAI's Grok image models, with configurable resolution, aspect ratio, and output format, paid via x402 micropayment.

## Facts

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

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-generation-via-locus-x402-2cc89da2 -d '<json body>'
```

Example prompt: Use Grok to generate a single 2k resolution 16:9 landscape image of a futuristic city at sunset with neon lights, using the grok-imagine-image-quality model, and return the image URL.

## When to prefer this

Choose this endpoint when you need AI image generation powered by xAI's Grok models specifically, want micropayment-based pay-per-call pricing via x402 (no subscription required), need control over resolution (1k/2k), aspect ratio, and output format (URL vs base64), or are building an agent pipeline that integrates Coinbase-compatible x402 payments natively.

## Known failure modes

- Invalid or missing prompt — returns error, no image generated
- Unsupported model ID — must be 'grok-imagine-image' or 'grok-imagine-image-quality'
- Unsupported resolution value — only '1k' or '2k' accepted
- Invalid aspect ratio string — must match accepted formats like '1:1', '16:9', etc.
- Payment failure — x402 payment not authorized or USDC balance insufficient
- Request timeout — image generation exceeds processing window
- n exceeds allowed batch limit — too many images requested at once

## How this service works

Locus public pay-per-use API

## Output

Returns a JSON object containing a `data` field with the generated image (as a URL or base64-encoded string depending on response_format), a `payment` object confirming 0.001 USDC was settled, a `request` object with a unique request ID and status URL for tracking, and a `success` boolean.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "n": {
   "type": "number"
  },
  "model": {
   "type": "string"
  },
  "prompt": {
   "type": "string"
  },
  "resolution": {
   "type": "string"
  },
  "aspect_ratio": {
   "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-generation-via-locus-x402-2cc89da2/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)
