# Agent402 Flux Pro Image Generation

> Agent402 Flux Pro Image Generation is a paid API for AI agents from agent402.tools, paid per call via x402, $0.05/call, status healthy (last checked 2026-09-14, last successful call 2026-09-14).

Generates a high-quality image from a text prompt using the FLUX.2-Pro model, returning a base64-encoded JPEG.

## Facts

- Endpoint: POST https://agent402.tools/v1/images/pro
- Price: $0.05/call
- Payment: x402
- Status: healthy
- Last checked: 2026-09-14
- Last successful call: 2026-09-14
- Success rate: 100% of calls made through Zero
- Rating: 4.7 / 5 from 1 review
- Activations on Zero: 9
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-flux-pro-image-generation-8a995d53
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_51Eqtm_OYuhxRvM1S-f-g

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-flux-pro-image-generation-8a995d53 -d '<json body>'
```

Example prompt: Generate a photorealistic image of a misty mountain lake at sunrise with pine trees reflected in the water and a small wooden rowboat in the foreground.

## When to prefer this

Choose this endpoint when you need pay-per-call image generation with no signup or API key — just a crypto wallet. It uses FLUX.2-Pro, a state-of-the-art model from Black Forest Labs, making it preferable when high visual quality is required. Ideal for agents in agentic finance or x402-native workflows where on-chain micropayments are the identity and access layer.

## Known failure modes

- Prompt exceeds 4,000 characters — request rejected
- Invalid or malformed JSON body — 400 error
- Insufficient USDC balance or payment failure — 402 error
- Content policy violation in prompt — generation refused
- Model temporarily unavailable — 503 or timeout
- Returned b64_json may be empty if generation fails silently

## How this service works

Higher-fidelity text-to-image over x402 - OpenAI images wire (prompt in, inline base64 out) at $0.05 per picture. Served by FLUX.2 Pro (about 9 seconds per image, 1024x1024 JPEG) with Qwen Image 3 at 1K as the failover. n locked to 1, text-to-image only, size and quality fixed. Point any OpenAI SDK's images.generate() at base_url https://agent402.tools/v1 and call /images/pro.

## Output

Returns a JSON object containing a data array with one entry holding a b64_json field (base64-encoded JPEG image data) and a media_type of image/jpeg. Also includes the model name (black-forest-labs/flux.2-pro), a created Unix timestamp, and usage stats showing total_tokens, prompt_tokens, 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-pro",
  "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-flux-pro-image-generation-8a995d53/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)
