{"uid":"cap_Gc2sqOksm3b73nhqLnwa8","slug":"x402-llm-gateway-4dc14c37","name":"x402 LLM Gateway","description":"OpenAI-compatible chat completions, priced per call at $0.01 USDC on Base. Payment uses the x402 protocol: an unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header; the client signs a USDC transfer, retries with a PAYMENT-SIGNATURE header, and the facilitator settles on-chain.","url":"https://x402.alexk.is/v1/chat/completions?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","description":"Model id. Omit to use the default."},"messages":{"type":"array","description":"Conversation so far, oldest first."},"max_tokens":{"type":"integer"},"temperature":{"type":"number"}}},"responseSchema":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"object":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}},"finish_reason":{"type":"string"}}}},"created":{"type":"integer"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_wwPTu3l-9JA1wRiaGuUnS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","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 the x402 on-chain micropayment protocol on Base.","exampleAgentPrompt":"Ask the LLM gateway to continue this conversation — messages so far are [{\"role\":\"user\",\"content\":\"Explain quantum entanglement in one paragraph\"}] — using default model settings and pay the $0.01 USDC fee automatically.","exampleUseCases":[{"title":"Per-call AI for autonomous agents","prompt":"I'm building an agent that needs to call an LLM occasionally without a monthly subscription — can you send this conversation to the x402 LLM gateway and pay the per-call USDC fee? Messages: [{\"role\":\"user\",\"content\":\"Summarize the key risks in this contract clause: indemnification applies to gross negligence.\"}]"},{"title":"Crypto-native chatbot prototype","prompt":"Use the x402 chat completions endpoint to reply to my user's message: 'What are the top three DeFi protocols on Base right now?' — keep the response concise, max 200 tokens, and settle the micropayment on-chain."},{"title":"Low-volume research assistant","prompt":"Send this question to the pay-per-use LLM gateway: 'Give me a step-by-step outline for a literature review on transformer attention mechanisms' — temperature 0.7, and go ahead and handle the USDC payment automatically."}],"resultDescription":"Returns an OpenAI-format chat completion object containing: a unique completion ID, the model used, a choices array with the assistant's message content, role, and finish reason, plus a Unix timestamp of when the response was created.","failureModes":["HTTP 402 returned if no payment signature is included — client must sign a USDC transfer and retry with PAYMENT-SIGNATURE header","Payment signature invalid or USDC balance insufficient — transaction rejected by facilitator","Model ID not found — returns error if unsupported model is specified","Malformed messages array — missing required 'role' or 'content' fields causes 400 error","Rate limit or upstream LLM unavailability — gateway may return 503 or timeout"],"whenToPreferThis":"Choose this endpoint when you need OpenAI-compatible chat completions with true pay-per-call billing in USDC on Base — ideal for autonomous agents, low-volume workloads, or crypto-native apps that want no subscription commitment and on-chain auditability of each inference cost. Prefer it over standard OpenAI or Anthropic APIs when your agent already handles x402 payment flows or when you need stablecoin-denominated AI spend.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T06:36:19.394Z","isFirstParty":false,"canonicalSlug":"x402-llm-gateway-4dc14c37"}