{"uid":"cap_Q1kTe74U8UZn39FfMq4T6","slug":"aile-ai-model-exchange-chat-completions-19f6e9d1","name":"Aile AI Model Exchange — Chat Completions","description":"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.","url":"https://api.aile.sh/v1/messages?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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."}}},"responseSchema":{"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"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0205","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0205/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0205","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0205","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__kBpouRz30Sc2hnoUi0U2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0205","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.'","exampleUseCases":[{"title":"Agent inference without direct API keys","prompt":"I don't have an Anthropic API key but I need to run a Claude Sonnet inference right now — can you call claude/claude-sonnet-5 through Aile with max 256 tokens and ask it: 'What are the top three use cases for stablecoin payments in 2025?'"},{"title":"Multi-model comparison via single endpoint","prompt":"Run the same prompt through openrouter/deepseek/deepseek-v4-flash on Aile with 300 max_tokens and a system prompt that says 'You are a concise analyst': 'Explain the risks of AI model vendor lock-in in two sentences.'"},{"title":"Autonomous agent pay-per-call AI reasoning","prompt":"My agent needs to reason about this customer support ticket — send it to codex/gpt-5.5 on Aile with 400 max_tokens and system prompt 'You are a customer support specialist': 'User is getting a 403 error when uploading files larger than 10MB. What is the most likely cause?'"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T12:34:55.859Z","isFirstParty":false,"canonicalSlug":"aile-ai-model-exchange-chat-completions-19f6e9d1"}