{"uid":"cap_ejDl8_dXB11sVe19hn5ve","slug":"xfuel-chat-completions-3d4ba92c","name":"XFuel Chat Completions","description":"Signed spend receipts for agent x402 payments — who paid which call, verifiable by a third party. Treasury desk and possession book for agent spend — export, policy, evidence. POST /v1/chat/completions is the x402 USDC door on Base and Solana. Returns signed receipt + public verify_url. Paying this host is real mainnet USDC.","url":"https://api.xfuel.app/v1/chat/completions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string","description":"Model id from GET /v1/models; xfuel/auto routes automatically"},"stream":{"type":"boolean"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant"],"type":"string"},"content":{"type":"string"}}},"description":"OpenAI-style chat messages array"},"max_tokens":{"type":"integer","description":"Output token budget"},"temperature":{"type":"number","maximum":2,"minimum":0}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-abc123","model":"xfuel/auto","usage":{"total_tokens":15,"prompt_tokens":10,"completion_tokens":5},"xfuel":{"verify_url":"https://api.xfuel.app/receipt/xfuel-abc123"},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}],"created":1700000000}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UdUSk0J2t1x5NgkDqSORT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"OpenAI-compatible chat completions endpoint that charges $0.01 USDC per call via x402 protocol on Base or Solana mainnet and returns a signed receipt with a verify URL","exampleAgentPrompt":"Using XFuel, send a chat message to the xfuel/auto model asking it to summarize the benefits of proof-of-work blockchains in 3 bullet points, with a max of 200 tokens and temperature 0.7 — and pay the $0.01 USDC fee from my Base wallet.","exampleUseCases":[{"title":"Autonomous agent self-funded LLM calls","prompt":"I want my agent to call XFuel's chat completions endpoint using the xfuel/auto model to answer user questions autonomously — it should pay its own $0.01 USDC inference fee from its Base wallet each time, with max 500 tokens and temperature 0.5."},{"title":"On-chain verifiable AI response","prompt":"Ask XFuel to generate a legal disclaimer paragraph using model xfuel/auto, up to 300 tokens, and give me back the signed receipt and verify URL so I can prove the AI response was paid for on-chain."},{"title":"Crypto-native chatbot prototype","prompt":"Build a quick chatbot prototype that uses XFuel with the xfuel/auto model, temperature 1.0, streaming enabled, and pays each inference call with USDC on Base — send it the system message 'You are a helpful assistant' and the user message 'What is DeFi?'"}],"resultDescription":"Returns an OpenAI-compatible chat completion response (choices, usage, model info) plus a signed payment receipt and a verify_url that can be used to confirm the on-chain USDC transaction on Base or Solana mainnet.","failureModes":["Insufficient USDC balance or failed x402 payment results in 402 Payment Required","Invalid or unsupported model ID returns a 400 or 404 error","Malformed messages array (missing role or content) causes a 422 validation error","Network congestion on Base or Solana may delay payment settlement and cause timeouts","Temperature out of range (below 0 or above 2) causes a validation error","Stream flag incompatibility with client setup may cause dropped or malformed streaming response"],"whenToPreferThis":"Choose XFuel when you need OpenAI-compatible chat completions billed via real USDC micropayments on Base or Solana — ideal for AI agents that manage their own crypto wallets and need verifiable, on-chain proof of inference spend. Prefer this over traditional API-key-based LLM providers when your architecture requires trustless, pay-per-call settlement or when you need a signed receipt for auditability. Not suited for high-volume batch inference where per-call transaction costs would be prohibitive.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T12:35:00.758Z","isFirstParty":false,"canonicalSlug":"xfuel-chat-completions-3d4ba92c"}