{"uid":"cap_KNleeqrH0zTnrw9QlG2mO","slug":"gedx402-chat-completions-x402-28b93c20","name":"GEDX402 Chat Completions (x402)","description":"Multi-model chat completions. POST messages[] and set model to any LLM id from GET /v1/models; dynamic USDC pricing scales with model and token usage. Hero: GET /heroes/chat-completions.","url":"https://chat.gedx402.com/v1/chat/completions","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}},"max_tokens":{"type":"integer"}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-example","object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_0NFo24Qy0IdIE7s_ruBzG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Send a chat conversation to Cloudflare Workers AI models and receive an AI-generated assistant reply, paid per-call with USDC via the x402 protocol — no API key required.","exampleAgentPrompt":"Using the GEDX402 Workers AI endpoint — paying with USDC, no API key — send this conversation to the 'smart' tier model and get a reply with up to 512 tokens: system says 'You are a helpful assistant', user says 'Explain what x402 payment protocol is in two sentences'.","exampleUseCases":null,"resultDescription":"Returns an OpenAI-compatible chat completion JSON object containing the assistant's generated reply, the finish reason (e.g. 'stop'), and metadata such as a completion ID and choice index.","failureModes":["402 Payment Required — USDC payment was not attached or was insufficient","Invalid model ID — requested model or tier alias does not exist; use GET /v1/models to list valid options","Malformed messages array — missing required role or content fields in one or more turns","max_tokens out of range — value must be between 1 and 4096","Payment network unsupported — submitted payment on a chain not accepted (Base, Polygon, Arbitrum, World, Solana only)","Model timeout — Workers AI inference took too long; retry with a faster tier alias like 'fast' or 'micro'"],"whenToPreferThis":"Choose this endpoint when you need LLM chat completions without managing API keys or subscriptions, and you can pay per-call in USDC via the x402 protocol. It is ideal for agents operating on-chain or in crypto-native environments, one-off inference tasks, or workflows where you want to avoid credential management. Prefer it over OpenAI or Anthropic direct APIs when the agent already holds USDC on Base, Polygon, Arbitrum, World, or Solana and needs a frictionless, keyless inference path backed by Cloudflare Workers AI.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:53.193Z","isFirstParty":false}