{"uid":"cap_AhTxYHWkBRvV1dyJFta7k","slug":"aile-ai-model-exchange-chat-completions-2c14c474","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/chat/completions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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"}}},"responseSchema":{"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"}]},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.020498","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.020498/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.020498","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.020498","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_bKeett2w723nbAwDLK9UR","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.020498","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"On-demand Claude access without subscription","prompt":"I don't have a Claude subscription — can you use Aile to send my draft email to claude/claude-sonnet-5 and have it rewrite it in a more professional tone? Cap the response at 300 tokens."},{"title":"Multi-model comparison via single endpoint","prompt":"Run the same prompt — 'Explain quantum entanglement simply' — through both openrouter/deepseek/deepseek-v4-flash and codex/gpt-5.5 on Aile, each capped at 150 tokens, and show me both responses side by side."},{"title":"Autonomous agent inference with crypto micropayment","prompt":"My agent needs to call an AI model to classify incoming support tickets — use Aile to send each ticket to openrouter/deepseek/deepseek-v4-flash with max_tokens 100 and pay per call in USDC automatically."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T04:29:54.717Z","isFirstParty":false,"canonicalSlug":"aile-ai-model-exchange-chat-completions-2c14c474"}