{"uid":"cap_kFnEZ0QSsK40Gl8mmo3XV","slug":"x402-ai-apis-gemini-chat-endpoint-641121f8","name":"x402 AI APIs – Gemini Chat Endpoint","description":"Paid AI API endpoints via x402 micropayments","url":"https://x402-ai-peach.vercel.app/api/gemini","method":"POST","headers":{},"bodySchema":{"type":"object","required":["messages"],"properties":{"stream":{"type":"boolean","description":"Stream response"},"messages":{"type":"array","description":"Chat messages array"},"max_tokens":{"type":"integer","description":"Max tokens"},"temperature":{"type":"number","description":"Temperature"}}},"responseSchema":{"type":"object","properties":{"id":{"type":"string","description":"Response ID"},"choices":{"type":"array","items":{"type":"object","properties":{"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}}}}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.125","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.125/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.125","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.125","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XaUG2r2qGhGHW2d5xBS-E","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.125","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Provides access to Google Gemini AI chat completions via x402 micropayment-gated API calls","exampleAgentPrompt":"Chat with the Gemini AI model and ask it to explain the difference between neural networks and decision trees — use a temperature of 0.7 and limit the response to 500 tokens.","exampleUseCases":[{"title":"Per-request AI assistant for agents","prompt":"Send these messages to the Gemini model: first a system message saying 'You are a helpful coding assistant', then a user message asking 'Write a Python function to parse JSON from a string' — keep temperature at 0.5 and max tokens at 300."},{"title":"Crypto-native chatbot backend","prompt":"I want to query Gemini with a conversation history — the user said 'What are the top 3 benefits of blockchain technology?' — stream the response back and cap it at 400 tokens."},{"title":"Pay-per-use content generation","prompt":"Use the Gemini API to generate a short product description for a wireless ergonomic keyboard — temperature 0.8, max 200 tokens, single user message as input."}],"resultDescription":"Returns a JSON object with a response ID and a choices array containing the AI-generated message, including the role (e.g. 'assistant') and the generated text content from Google Gemini.","failureModes":["Payment failure if x402 micropayment of $0.125 USDC is not completed or wallet is underfunded","Invalid messages array format causing 400 Bad Request","Exceeding max_tokens limit causing truncated or error response","Temperature value out of valid range (typically 0.0–2.0) causing validation error","Network timeout if streaming is enabled and connection drops mid-response","Rate limiting or quota exhaustion on the underlying Gemini API"],"whenToPreferThis":"Choose this endpoint when you need pay-per-call access to Google Gemini without a monthly subscription, especially in agentic or autonomous workflows where usage is sporadic and crypto-native micropayment settlement via x402 is preferred. Ideal for agents that need to avoid pre-committed API quotas and want fine-grained cost control at $0.125 USDC per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:38:24.482Z","isFirstParty":false}