{"uid":"cap_Rjyiyidq7C__3IbW5MozD","slug":"onchain-router-llm-inference-anthropic-compatible-ce64ad30","name":"Onchain Router LLM Inference (Anthropic-Compatible)","description":"Give agents provider-neutral access to text, image, and speech models with USDC payments on Base, local spending controls, ambiguity-safe recovery, and verified receipts. Stable public npm clients and MIT agent integrations are available now.","url":"https://onchainrouter.dev/v1/messages","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"enum":["gemini-3.6-flash","gemini-3.5-flash-lite","gemini-3.5-flash","gemini-3.1-flash-lite","gemini-2.5-flash","gemini-2.5-pro","gemini-2.5-flash-lite","venice/z-ai-glm-5-3","venice/z-ai-glm-5-3-flash","venice/zai-org-glm-5-2","venice/zai-org-glm-5-1","venice/zai-org-glm-5","venice/z-ai-glm-5-turbo","venice/z-ai-glm-5v-turbo","venice/olafangensan-glm-4.7-flash-heretic","venice/zai-org-glm-4.7-flash","venice/zai-org-glm-4.6","venice/zai-org-glm-4.7","venice/venice-uncensored-1-2","venice/venice-uncensored-role-play","venice/qwen-3-8-2-4t-a95b","venice/qwen-3-8-max","venice/qwen-3-8-27b","venice/qwen-3-7-max","venice/qwen-3-7-plus","venice/qwen-3-6-plus","venice/qwen3-6-27b","venice/qwen3-6-35b-a3b","venice/qwen3-5-9b","venice/qwen3-5-397b-a17b","venice/qwen3-5-35b-a3b","venice/qwen3-235b-a22b-thinking-2507","venice/qwen3-235b-a22b-instruct-2507","venice/qwen3-next-80b","venice/qwen3-vl-235b-a22b","venice/qwen3-coder-480b-a35b-instruct-turbo","venice/grok-4-3","venice/grok-4-5","venice/grok-4-6","venice/grok-4-20","venice/grok-4-20-multi-agent","venice/grok-build-0-1","venice/mistral-small-3-2-24b-instruct","venice/mistral-small-2603","venice/hermes-3-llama-3.1-405b","venice/claude-fable-5","venice/claude-fable-5-1","venice/claude-opus-5","venice/claude-opus-5-fast","venice/claude-opus-4-8","venice/claude-opus-4-8-fast","venice/claude-opus-4-7","venice/claude-opus-4-6","venice/claude-opus-4-5","venice/claude-sonnet-5","venice/claude-sonnet-4-6","venice/claude-sonnet-4-5","venice/openai-gpt-oss-120b","venice/kimi-k2-6","venice/kimi-k2-7-code","venice/kimi-k2-5","venice/kimi-k3","venice/inkling","venice/xiaomi-mimo-v2-5","venice/deepseek-v4-pro","venice/deepseek-v4-flash","venice/deepseek-v4-flash-0731","venice/deepseek-v3.2","venice/seed-2-1-turbo","venice/deepseek-v4-pro-0813","venice/kimi-k3-fast-api","venice/deepseek-v4-flash-0731-fast","venice/aion-labs-aion-3-0","venice/aion-labs-aion-3-0-mini","venice/llama-3.2-3b","venice/llama-3.3-70b","venice/openai-gpt-52","venice/openai-gpt-52-codex","venice/openai-gpt-53-codex","venice/openai-gpt-54","venice/openai-gpt-54-pro","venice/openai-gpt-54-mini","venice/openai-gpt-55","venice/openai-gpt-55-pro","venice/openai-gpt-56-luna","venice/openai-gpt-56-luna-pro","venice/openai-gpt-56-terra","venice/openai-gpt-56-terra-pro","venice/openai-gpt-56-sol","venice/openai-gpt-56-sol-pro","venice/openai-gpt-6-astra","venice/openai-gpt-6-astra-pro","venice/openai-gpt-4o-2024-11-20","venice/openai-gpt-4o-mini-2024-07-18","venice/minimax-m3-preview","venice/minimax-m25","venice/minimax-m27","venice/mercury-2","venice/nvidia-nemotron-3-nano-30b-a3b","venice/nvidia-nemotron-3-ultra-550b-a55b"],"type":"string"},"stream":{"type":"boolean","const":false},"messages":{"type":"array"},"max_tokens":{"type":"integer","maximum":65536,"minimum":1}}},"responseSchema":{"type":"json","example":{"id":"msg_example","role":"assistant","type":"message","model":"gemini-3.6-flash","content":[{"text":"Hello","type":"text"}]}},"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_YRQqM0BIkNzDFyJt1DUiL","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":"Routes Anthropic-compatible chat completion requests to Google Gemini models, billed per-request on-chain via x402","exampleAgentPrompt":"Ask gemini-2.5-flash to summarize the following article in 3 bullet points, up to 1024 tokens: 'OpenAI announced a new model today that outperforms GPT-4 on coding benchmarks...' — pay per request using my USDC wallet.","exampleUseCases":[{"title":"On-chain AI assistant for dApps","prompt":"Send this user's question to gemini-2.5-flash using the Anthropic messages format — max 2048 tokens — and bill my USDC wallet per request: 'How do I stake ETH on a Layer 2 network?'"},{"title":"Cost-controlled content drafting","prompt":"Use gemini-2.5-pro to write a professional LinkedIn post about our product launch based on these bullet points: 'faster inference, lower cost, no subscriptions' — keep it under 512 tokens and charge per call."},{"title":"Automated code review bot","prompt":"Run this code snippet through gemini-2.5-flash and ask it to identify any bugs or style issues, limit the response to 1024 tokens: 'def add(a,b): return a+b+1'"}],"resultDescription":"Returns an Anthropic-style JSON message object with role 'assistant', a content array containing a text block, the model name used, and a message ID. Response is non-streaming and includes the generated text completion.","failureModes":["Insufficient USDC balance causes payment failure and 402 response","Unsupported model name not in the allowed enum returns a validation error","max_tokens exceeding 65536 is rejected","stream:true is not supported and will be rejected (const false)","Upstream Gemini API unavailability causes 502/503 errors","Malformed messages array causes 400 bad request"],"whenToPreferThis":"Choose this endpoint when you need Anthropic SDK-compatible chat completions backed by Google Gemini models, want pay-per-request billing in USDC via x402 with no subscription, or are building an agent that needs on-chain verifiable AI inference costs. Prefer this over native Google or Anthropic APIs when your stack already uses the Anthropic messages format but you want Gemini models or microtransaction billing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:40:47.499Z","isFirstParty":false}