# Aile AI Model Exchange – Chat Completions

> Aile AI Model Exchange – Chat Completions is a paid API for AI agents from api.aile.sh, paid per call via x402, $0.020498/call, status unknown (last checked 2026-10-11).

Routes a chat completion request to a selected premium AI model (e.g. Claude, GPT, DeepSeek) through Aile's metered exchange, settling payment per call in USDC on Solana via x402.

## Facts

- Endpoint: POST https://api.aile.sh/v1/chat/completions?utm_source=zero.xyz
- Price: $0.020498/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aile-ai-model-exchange-chat-completions-2c14c474
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AhTxYHWkBRvV1dyJFta7k

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-model-exchange-chat-completions-2c14c474 -d '<json body>'
```

Example prompt: Using the Aile exchange, send the message 'Summarize the history of Solana in 3 sentences' to claude/claude-sonnet-5 with a max_tokens ceiling of 200.

## When to prefer this

Choose Aile's chat completions endpoint when you need access to multiple premium AI models (Claude, GPT, DeepSeek, etc.) without managing separate API keys or subscriptions, and want pay-per-call billing settled in USDC on Solana via x402. Ideal for autonomous agents that need to dynamically select among catalogued models and pay programmatically per inference call. Prefer over direct provider APIs when you want a single unified endpoint, crypto-native micropayment settlement, or access to models whose direct API keys you don't hold.

## Known failure modes

- Insufficient USDC balance or failed x402 payment — call rejected before inference
- Invalid or uncatalogued model ID — 400 error; use GET /v1/models to list available models
- max_tokens set too high relative to wallet balance — quote exceeds available funds
- stream:true requested on x402 path — SSE streaming is unsupported on this payment route
- Model provider temporarily unavailable — upstream inference error propagated
- Malformed messages array — missing required role or content fields triggers validation error

## 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 an OpenAI-compatible chat.completion object containing the assistant's reply text, the model used, token counts (prompt, completion, total), a completion ID, and finish_reason. Token usage drives the metered USDC charge settled on Solana.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "model",
  "messages"
 ],
 "properties": {
  "model": {
   "type": "string",
   "description": "A catalogued model id, namespaced by its provider — e.g. `claude/claude-sonnet-5`, `codex/gpt-5.5`, `openrouter/deepseek/deepseek-v4-flash`. GET /v1/models lists what is servable right now."
  },
  "stream": {
   "type": "boolean",
   "description": "SSE token stream when true. Not available on the x402 path."
  },
  "messages": {
   "type": "array",
   "description": "The conversation so far, oldest first."
  },
  "max_tokens": {
   "type": "integer",
   "description": "Upper bound on generated tokens. THE PRICE IS QUOTED AGAINST THIS, so a smaller ceiling is a smaller quote."
  },
  "temperature": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "id": "chatcmpl-…",
 "model": "openrouter/deepseek/deepseek-v4-flash",
 "usage": {
  "total_tokens": 44,
  "prompt_tokens": 28,
  "completion_tokens": 16
 },
 "object": "chat.completion",
 "choices": [
  {
   "index": 0,
   "message": {
    "role": "assistant",
    "content": "…"
   },
   "finish_reason": "stop"
  }
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aile-ai-model-exchange-chat-completions-2c14c474/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)
