{"uid":"cap_rbRnqXGA8EdwiHhoGd3Mb","slug":"agent402-gemini-api-proxy-pay-per-call-35c115c4","name":"Agent402 Gemini API Proxy (Pay-Per-Call)","description":"Google's native generateContent wire on the premium tier. Send Gemini's own request shape (contents, systemInstruction, generationConfig, function declarations) and get Gemini's own response shape (candidates, usageMetadata) back. Point a Google GenAI SDK at this gateway and pay per request with USDC, no account. Also answers the Google-shaped path /v1beta/models/<model>:generateContent.","url":"https://agent402.tools/v1/premium/gemini?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string","description":"Optional; the Google-shaped path carries it (/v1beta/models/<model>:generateContent)"},"tools":{"type":"array","description":"[{functionDeclarations:[{name, description, parameters}]}]"},"contents":{"type":"array","description":"Gemini turns: [{role, parts:[{text}|{inlineData}]}]"},"generationConfig":{"type":"object","description":"maxOutputTokens, temperature, topP, stopSequences, responseMimeType, responseSchema"},"systemInstruction":{"type":"object","description":"Optional system turn: {parts:[{text}]}"}}},"responseSchema":{"type":"json","example":{"candidates":[{"index":0,"content":{"role":"model","parts":[{"text":"x402 is an HTTP-native way for agents to pay per request with USDC."}]},"finishReason":"STOP"}],"modelVersion":"google/gemini-3.5-flash-lite","usageMetadata":{"totalTokenCount":32,"promptTokenCount":14,"candidatesTokenCount":18}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.5","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.5/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.5","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.5","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OrTxJDSJpC6RVUpl78n4v","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.5","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Proxies a single Google Gemini content-generation request over x402 micropayment protocol, returning a Gemini-shaped response with no API key required.","exampleAgentPrompt":"Send this conversation to Gemini 2.5 Flash and get a response — use the system instruction 'You are a helpful assistant', the user message 'Explain x402 in one sentence', and pay the per-call fee automatically.","exampleUseCases":[{"title":"Keyless Gemini access for autonomous agent","prompt":"My agent needs to call Gemini 2.5 Flash to answer a user question without me managing API keys — send the user turn 'What is the capital of France?' with no system prompt and return the model's reply, paying per call with USDC."},{"title":"Structured JSON extraction with Gemini","prompt":"Use Gemini to extract the company name, date, and total amount from this invoice text and return the result as a JSON object — set responseMimeType to application/json and include the invoice text as the user message."},{"title":"Agentic tool-use via Gemini function calling","prompt":"Call Gemini with a function declaration for get_weather that takes a city string, pass the user message 'What's the weather in Tokyo?', and let Gemini decide whether to call the tool — I'll handle the function result on my end."}],"resultDescription":"A Gemini-shaped JSON response containing an array of candidates, each with the model's generated content (role and text parts), a finishReason, the modelVersion string, and usageMetadata showing prompt, candidate, and total token counts.","failureModes":["402 Payment Required if x402 payment header is missing or USDC balance is insufficient","400 Bad Request if contents array is malformed or missing required fields","Model not found if an unsupported model name is specified","429 Rate limit if too many concurrent requests are made","Timeout or 503 if the upstream Gemini API is unavailable"],"whenToPreferThis":"Choose this endpoint when you need to call Google Gemini from an autonomous AI agent without managing API keys or subscriptions, especially when operating in a pay-per-call or micropayment (x402/USDC) billing environment. It is ideal for agents that make sporadic or variable-volume Gemini calls where pre-paying for a quota would be wasteful, or when the agent runtime cannot securely store long-lived credentials.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-28T15:40:38.444Z","isFirstParty":false,"canonicalSlug":"agent402-gemini-api-proxy-pay-per-call-35c115c4"}