# Aile AI Image Generation

> Aile AI Image Generation is a paid API for AI agents from api.aile.sh, paid per call via x402, $0.01575/call, status unknown (last checked 2026-10-12).

Generate images from a text prompt using premium AI image models (e.g. FLUX) accessed via Aile's token marketplace, paying per image in USDC on Solana.

## Facts

- Endpoint: POST https://api.aile.sh/v1/images/generations?utm_source=zero.xyz
- Price: $0.01575/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aile-ai-image-generation-1618e7ba
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RRNmrl3a1Vu73HbI8AfBu

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 aile-ai-image-generation-1618e7ba -d '<json body>'
```

Example prompt: Using Aile with the openrouter/black-forest-labs/flux.2-pro model, generate a 1024x1024 image of a glowing neon cityscape at night with rain-soaked streets reflecting the lights.

## When to prefer this

Choose Aile's image generation endpoint when you need access to premium image models (like FLUX Pro) without holding a direct API subscription, or when you want per-call metered billing settled in USDC on Solana with no upfront commitment. It is especially useful for agents that want to select from a marketplace of multiple image model providers using a single API contract and pay-as-you-go pricing.

## Known failure modes

- Model not available — requested model not listed under /v1/models?output_modalities=image; returns refusal rather than coercion
- Unsupported size — if the size string is not in the model's accepted list, the request is refused
- Payment failure — USDC payment on Solana not settled, resulting in a 402 or authorization error
- Invalid prompt — empty or missing prompt field causes a 400 validation error
- n > 1 with x402 — x402 protocol may only authorize one payment per request, causing issues if n>1 is requested

## How this service works

Rent trusted AI models priced per token; lend idle subscriptions and API keys. A live, metered market that settles every call in USDC on Solana.

## Output

Returns a JSON object with a `data` array containing one base64-encoded PNG (b64_json field) per image generated, along with a Unix `created` timestamp. The agent can decode the base64 string to get the raw image bytes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "model",
  "prompt"
 ],
 "properties": {
  "n": {
   "type": "integer",
   "description": "How many images. THE PRICE IS PER IMAGE; x402 takes one per request."
  },
  "size": {
   "type": "string",
   "description": "e.g. `1024x1024`; the model's own list, refused rather than coerced."
  },
  "model": {
   "type": "string",
   "description": "`<provider>/<model>`, e.g. `openrouter/black-forest-labs/flux.2-pro`. GET /v1/models?output_modalities=image lists what is servable, with prices."
  },
  "prompt": {
   "type": "string",
   "description": "What to draw."
  },
  "quality": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "data": [
  {
   "b64_json": "iVBORw0KGgo…"
  }
 ],
 "created": 1760000000
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aile-ai-image-generation-1618e7ba/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.aile.sh](https://www.zero.xyz/host/api.aile.sh/llms.txt)
