{"uid":"cap_CDLmYpBBrJQdedPS3LFj3","slug":"onchain-router-ai-model-routing-via-x402-usdc-payment-4fd83ebc","name":"Onchain Router – AI Model Routing via x402 USDC Payment","description":"Anthropic-compatible request-priced llm inference · 0% service fee launch promotion","url":"https://llm.agenticfi.wtf/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"],"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_sLYJgYOi2PWuWVUNSq2L9","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 LLM inference requests (text, image, speech) across Google Gemini model variants through a provider-neutral API, billing per-request in USDC with an on-chain receipt.","exampleAgentPrompt":"Use Gemini 2.5 Flash through the Onchain Router to answer: 'Explain the difference between proof-of-work and proof-of-stake in three sentences,' with a max of 512 tokens, paying in USDC per request.","exampleUseCases":[{"title":"Agent-to-agent LLM calls with crypto billing","prompt":"Have my automation agent call Gemini 2.5 Flash via the Onchain Router to summarize this support ticket and pay for each call automatically in USDC — limit each response to 1024 tokens."},{"title":"Web3-native chatbot backend","prompt":"Power my dapp's chatbot using Gemini 2.5 Pro through the Onchain Router so every inference is billed in USDC on-chain; set max tokens to 4096 and send the user's message as the prompt."},{"title":"Cost-tracked content generation pipeline","prompt":"Use the Onchain Router with Gemini 3.5 Flash to generate a product description for 'wireless noise-cancelling headphones,' cap it at 256 tokens, and make sure I get a receipt for the USDC charge."}],"resultDescription":"Returns a JSON object with an assistant message containing the model's text response, the message ID, the model name used, role set to 'assistant', and a durable on-chain USDC payment receipt. The response follows the Anthropic Messages API shape (content array with text blocks).","failureModes":["Insufficient USDC balance causes payment failure and a 402 Payment Required response","Invalid or unsupported model enum value returns a 400 validation error","max_tokens out of range (below 1 or above 65536) returns a schema validation error","stream:true is not supported and returns an error (only stream:false is allowed)","Empty or malformed messages array causes a 400 bad request","Network or upstream Gemini provider outage results in a 503 or timeout"],"whenToPreferThis":"Choose this endpoint when you need to call Gemini LLM models without managing Google API keys directly, want per-request USDC billing with an on-chain receipt for auditability, are building a web3-native or agent-to-agent workflow that requires crypto-native payment rails, or want a provider-neutral API surface compatible with the Anthropic Messages format pointing at Google Gemini backends.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:37:36.830Z","isFirstParty":false}