# 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).

Generates images from text prompts using premium AI models (e.g. Flux) via the Aile model marketplace, billed per call in USDC on Solana.

## Facts

- Endpoint: POST https://api.aile.sh/v1/images?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-6f6c85ae
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tuHskLjJKv-CRDxeDC52V

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-6f6c85ae -d '<json body>'
```

Example prompt: Using Aile with the openrouter/black-forest-labs/flux-1.1-pro model, generate a photorealistic image of a misty mountain forest at dawn with a 16:9 aspect ratio.

## When to prefer this

Choose this endpoint when you need pay-per-call access to premium image generation models (like Flux Pro) without a long-term subscription, especially when paying with USDC on Solana via x402. Prefer it over direct provider APIs when you want metered, trustless billing or access to multiple model providers through a single interface.

## Known failure modes

- Invalid or unsupported model identifier returns an error — use GET /v1/models?output_modalities=image to list valid models
- Prompt too long or content policy violation causes rejection
- Insufficient USDC balance or failed x402 payment causes the call to be rejected
- Unsupported resolution or aspect_ratio for non-OpenRouter models
- Invalid input_references URL causes image edit to fail
- Rate limiting or model unavailability from upstream provider

## 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 containing an array of generated images as base64-encoded PNG data (b64_json) and a Unix timestamp (created). Each image can be decoded and saved or displayed directly.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "model",
  "prompt"
 ],
 "properties": {
  "n": {
   "type": "integer"
  },
  "seed": {
   "type": "integer"
  },
  "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"
  },
  "resolution": {
   "type": "string",
   "description": "openrouter/* models only."
  },
  "aspect_ratio": {
   "type": "string",
   "description": "e.g. `16:9` (openrouter/* models)."
  },
  "input_references": {
   "type": "array",
   "description": "Input images (https URLs or data URIs); makes the request an edit."
  }
 }
}
```

## 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-6f6c85ae/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)
