# 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.0205/call, status unknown (last checked 2026-10-12).

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

## Facts

- Endpoint: POST https://api.aile.sh/v1/messages?utm_source=zero.xyz
- Price: $0.0205/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-model-exchange-chat-completions-19f6e9d1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q1kTe74U8UZn39FfMq4T6

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-19f6e9d1 -d '<json body>'
```

Example prompt: Using the Aile model exchange, send this conversation to claude/claude-sonnet-5 with a 512 max_tokens limit and tell me what it says: 'You are a helpful assistant. User: Summarize the key benefits of Solana for payment settlement.'

## When to prefer this

Choose this endpoint when you need on-demand access to premium AI models (Claude, GPT, DeepSeek) without managing direct API subscriptions, when your agent needs to pay per inference in USDC programmatically, or when you want a single unified endpoint to route across multiple AI providers. It is especially suitable for autonomous agents that need to settle AI inference costs in stablecoin on Solana without pre-negotiated subscription commitments.

## Known failure modes

- Insufficient USDC balance — payment not settled, call rejected
- Invalid or unavailable model ID — model not listed in /v1/models at that moment
- max_tokens not provided — required field missing causes validation error
- Streaming (stream: true) requested on the x402 payment path — not supported
- Model provider outage or capacity issue causing upstream failure
- Malformed messages array — missing role or content fields

## 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 the assistant's reply text in content[0].text, the model used, input and output token counts, and the stop reason (e.g. end_turn). The response mirrors the Anthropic Messages API format.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "model",
  "messages",
  "max_tokens"
 ],
 "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."
  },
  "system": {
   "type": "string",
   "description": "System prompt, as a top-level field in this format."
  },
  "messages": {
   "type": "array",
   "description": "The conversation so far, oldest first."
  },
  "max_tokens": {
   "type": "integer",
   "description": "Required by this format. THE PRICE IS QUOTED AGAINST IT."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "id": "msg_…",
 "role": "assistant",
 "type": "message",
 "model": "claude/claude-sonnet-5",
 "usage": {
  "input_tokens": 28,
  "output_tokens": 16
 },
 "content": [
  {
   "text": "…",
   "type": "text"
  }
 ],
 "stop_reason": "end_turn"
}
```

## More

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