# agent402.tools GPT Image Generation

> agent402.tools GPT Image Generation is a paid API for AI agents from agent402.tools, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-14).

Generates a 1024x1024 PNG image from a text prompt using GPT Image (mini, low quality), returning a base64-encoded result with pay-per-call billing via x402.

## Facts

- Endpoint: POST https://agent402.tools/api/image-gen
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-gpt-image-generation-ca10ed40
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FGCFrPKGn_VrrHgnl_nD7

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 agent402-tools-gpt-image-generation-ca10ed40 -d '<json body>'
```

Example prompt: Generate an image of a golden retriever puppy playing in autumn leaves in a sunny park — I need it as a base64 PNG.

## When to prefer this

Choose this endpoint when you need a quick, low-cost AI-generated image without managing your own API keys or subscriptions. It is ideal for agents that need pay-per-use image generation via x402 micropayments at $0.03 USDC per call, and when a 1024x1024 low-quality PNG is sufficient for the use case.

## Known failure modes

- Prompt exceeds 1000 characters — request rejected with validation error
- Payment via x402 fails or is insufficient — call not processed
- OpenAI GPT Image service unavailable — upstream error returned
- Empty or missing prompt field — bad request error
- Content policy violation in prompt — generation refused

## How this service works

Generate an image from a text prompt using GPT Image 2 (low quality, 1024x1024). No API key needed; pay per call via x402. Returns base64 PNG. Prompt capped at 1000 chars.

## Output

A base64-encoded PNG image at 1024x1024 resolution, generated by GPT Image (mini, low quality) based on the provided text prompt. The agent receives the raw base64 string which can be decoded and saved or rendered directly.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "string",
   "description": "Text description of the desired image (max 1000 chars)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "size": "1024x1024",
  "image": "<base64-encoded PNG>",
  "model": "gpt-image-2",
  "quality": "low",
  "provider": "openai",
  "revised_prompt": "A single red apple on a white background"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-gpt-image-generation-ca10ed40/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
