# Agent402.Tools Fast Image Generation

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

Generates a JPEG image from a text prompt using the FLUX.2 Klein 4B model, returning base64-encoded image data

## Facts

- Endpoint: POST https://agent402.tools/v1/images/fast
- Price: $0.02/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-fast-image-generation-a04f2bce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_a4FTTANxpH63KJkxgp9t1

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-fast-image-generation-a04f2bce -d '<json body>'
```

Example prompt: Generate an image of a sun-drenched Tuscan vineyard at golden hour, with rolling hills in the background, rustic stone farmhouse, and rows of grapevines casting long shadows.

## When to prefer this

Choose this endpoint when you need fast, pay-per-call image generation with no API key signup, paying per image with USDC via x402. It is especially suitable for AI agents that already operate in the x402 payment ecosystem and need FLUX-quality imagery on demand. Prefer it over OpenAI DALL-E or Stability AI endpoints when you want a wallet-based identity model and FLUX.2 Klein aesthetics specifically.

## Known failure modes

- Prompt exceeds 4,000 characters — request rejected or truncated
- Payment failure — insufficient USDC balance or x402 wallet not configured
- Model unavailability — upstream FLUX model service outage
- Malformed request body — missing or non-string `prompt` field
- Content policy violation — prompt contains disallowed content and is rejected

## How this service works

Generate an image from a text prompt at a flat price per picture, no token math and no subscription: the OpenAI images request shape in, base64 PNG or JPEG out, with an automatic fallback model so a provider outage does not become your error. Use it when an agent needs a picture cheaply and predictably.

## Output

A JSON object containing a `data` array with one entry holding a `b64_json` field (base64-encoded JPEG image) and `media_type` of `image/jpeg`, along with the model name (`black-forest-labs/flux.2-klein-4b`), creation timestamp, and token usage stats (total, prompt, and completion tokens).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "string",
   "description": "Text description of the image to generate (up to 4,000 chars)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": [
   {
    "b64_json": "/9j/4AAQSkZJRgABAQAAAQABAAD…",
    "media_type": "image/jpeg"
   }
  ],
  "model": "black-forest-labs/flux.2-klein-4b",
  "usage": {
   "total_tokens": 4107,
   "prompt_tokens": 11,
   "completion_tokens": 4096
  },
  "created": 1750000000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-fast-image-generation-a04f2bce/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)
