{"uid":"cap_KyH7tY-Yo9Npxfp7LMY6m","slug":"onchain-router-openai-compatible-llm-chat-completions-gemini-models-05f159ae","name":"Onchain Router – OpenAI-Compatible LLM Chat Completions (Gemini Models)","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/chat/completions","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":"chatcmpl_example","model":"gemini-3.6-flash","usage":{"total_tokens":0,"prompt_tokens":0,"completion_tokens":0},"object":"chat.completion","choices":[]}},"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_rzqsqa8ncrqPsM6rXAp-E","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":"Provides OpenAI-compatible chat completions using Google Gemini models, billed per-request via x402 micropayments with no service fee during launch","exampleAgentPrompt":"Ask gemini-2.5-flash to summarize the following meeting notes in 3 bullet points, and cap the response at 500 tokens — pay per request so I don't need a Google API subscription.","exampleUseCases":[{"title":"On-demand LLM inference for autonomous agents","prompt":"I need my agent to call gemini-2.5-pro to analyze this legal document and extract key obligations — use pay-per-call billing via USDC so I'm not locked into a monthly plan, and limit the response to 2048 tokens."},{"title":"Gemini model comparison without subscriptions","prompt":"Run this product description through both gemini-2.5-flash and gemini-2.5-flash-lite and tell me which one gives a better marketing tagline — I want to pay per call rather than manage API keys."},{"title":"Chatbot backend with micropayment billing","prompt":"Use gemini-3.5-flash to respond to this customer support message: 'My order hasn't arrived after 2 weeks, what should I do?' — keep the reply under 300 tokens and bill it per request."}],"resultDescription":"Returns an OpenAI-compatible chat.completion JSON object containing an id, model name used, array of completion choices with message content, and a usage object with prompt_tokens, completion_tokens, and total_tokens counts.","failureModes":["Payment failure if USDC balance insufficient or x402 handshake fails","Invalid model name returns 422 validation error","max_tokens exceeding 65536 returns schema validation error","stream:true not supported, will fail if set to true","Empty or malformed messages array returns error","Rate limiting if too many concurrent requests"],"whenToPreferThis":"Choose this endpoint when you need OpenAI-compatible Gemini inference billed per-request via USDC micropayments (x402), especially when avoiding subscription commitments, rotating between Gemini model tiers (flash-lite through pro), or building autonomous agents that require transparent per-call cost accounting on-chain. Prefer over direct Google AI Studio if you want API-key-free, crypto-native billing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:39:51.199Z","isFirstParty":false}