# x402 AI Image Generation

> x402 AI Image Generation is a paid API for AI agents from x402-ai-api.civicmerge.workers.dev, paid per call via x402, $0.030000/call, not verified (last probed 2026-10-10); live alternatives: WithZero Grok Imagine Image Generation ($0.05) and Generate Images via Google Gemini 3.1 Flash ($0.07).

Agents call it through Zero, which pays per call: no API key and no wallet of your own. New accounts start with $5.

Live alternatives for the same use case:
- [WithZero Grok Imagine Image Generation](https://www.zero.xyz/c/withzero-grok-imagine-image-generation-58f6270b) ($0.05)
- [Generate Images via Google Gemini 3.1 Flash](https://www.zero.xyz/c/image-withzero-xyz-generate-images-via-google-gemini-3-1-flash-nano-a910a17d) ($0.07)

Generates images from text prompts using selectable quality tiers (fast, enhanced, pro, premium, phoenix, sdxl, etc.) via a pay-per-call API

## Facts

- Endpoint: POST https://x402-ai-api.civicmerge.workers.dev/v1/images/generate?utm_source=zero.xyz
- Price: $0.030000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Last successful call: 2026-06-30
- Success rate: 67% of calls made through Zero
- Rating: 3.3 / 5 from 3 reviews
- Activations on Zero: 3
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-ai-api-civicmerge-workers-dev-abd114e7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vv8dg1kxX1WqqLh__Ug61

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 x402-ai-api-civicmerge-workers-dev-abd114e7 -d '<json body>'
```

Example prompt: Generate a photorealistic image of a futuristic cityscape at night with neon lights reflecting on rain-soaked streets, using the 'pro' quality model at 1024x1024.

## When to prefer this

Choose this endpoint when you need fast, pay-per-call AI image generation with multiple quality tiers (including SDXL, DreamShaper, inpainting, and img2img variants) and want to pay micro-amounts per image without a subscription. Especially useful for agents that need on-demand image creation within an x402 payment workflow.

## Known failure modes

- Invalid model enum value returns 400 error
- Prompt missing from request body returns validation error
- Payment failure (insufficient USDC or x402 protocol error) returns 402 Payment Required
- Width or height out of supported range returns error
- Service unavailable on Cloudflare Workers returns 503

## How this service works

AI image generation

## Output

The agent receives a generated image (URL or binary data) corresponding to the text prompt, produced at the specified model quality tier and image dimensions.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "enum": [
    "fast",
    "enhanced",
    "pro",
    "premium",
    "phoenix",
    "sdxl",
    "sdxl-light",
    "dreamshaper",
    "img2img",
    "inpaint"
   ],
   "type": "string",
   "description": "Quality tier"
  },
  "width": {
   "type": "integer",
   "default": 1024
  },
  "height": {
   "type": "integer",
   "default": 1024
  },
  "prompt": {
   "type": "string",
   "description": "Text prompt for image generation"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-ai-api-civicmerge-workers-dev-abd114e7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-ai-api.civicmerge.workers.dev](https://www.zero.xyz/host/x402-ai-api.civicmerge.workers.dev/llms.txt)
