# x402donghang Image Generation

> x402donghang Image Generation is a paid API for AI agents from x402donghang.duckdns.org, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Generates an AI image from a text prompt using the Bailian turbo model, paid per-call via USDC over x402 protocol

## Facts

- Endpoint: POST https://x402donghang.duckdns.org/x402/v1/image-gen
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402donghang-image-generation-0386e11b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_63SsP_cIqhjP3lXExLI1f

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 x402donghang-image-generation-0386e11b -d '<json body>'
```

Example prompt: Draw me a glowing bitcoin coin on dark sea glass, minimal style, in 1024x1024 square format — pay per call with no signup needed.

## When to prefer this

Choose this endpoint when you need a quick, no-signup, pay-per-call AI image generation with USDC crypto payment via the x402 protocol. Best for agents or developers who want to avoid subscription plans and pay only for what they use. Use it when you need support for multiple aspect ratios (square, landscape, portrait, widescreen) and are comfortable with the Bailian turbo model output quality.

## Known failure modes

- Prompt too long (over 2000 chars) — validation error returned
- Empty prompt — minLength 1 validation rejected
- Invalid size enum value — rejected with schema error
- Payment failure or insufficient USDC — x402 payment error
- Server/model unavailability — non-200 or error JSON response
- Image generation failure — ok: false in response body

## How this service works

Fresh crypto narrative research with market context and verifiable source URLs. Free BTC sample; custom radar $0.02/call via x402 USDC.

## Output

A JSON object containing ok (boolean), the image URL hosted on the provider's server, the selected size, model name ('z-image (Bailian turbo)'), tier ('standard'), price ('$0.05'), and the original prompt echoed back.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "size": {
   "enum": [
    "1024x1024",
    "1280x720",
    "1536x1024",
    "1024x1536"
   ],
   "type": "string",
   "description": "Output size; default 1024x1024 on the standard tier"
  },
  "prompt": {
   "type": "string",
   "maxLength": 2000,
   "minLength": 1,
   "description": "Text description of the image to draw"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "size": "1024x1024",
  "tier": "standard",
  "model": "z-image (Bailian turbo)",
  "price": "$0.05",
  "prompt": "a glowing bitcoin coin on dark sea glass, minimal",
  "product": "image-gen",
  "image_url": "https://x402donghang.duckdns.org/x402/media/images/img_20260827_abcd.png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402donghang-image-generation-0386e11b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402donghang.duckdns.org](https://www.zero.xyz/host/x402donghang.duckdns.org/llms.txt)
