{"uid":"cap_ATTbBkrkevh5vpmovl7FO","slug":"agent402-metered-gemini-inference-9ab912a1","name":"Agent402 Metered Gemini Inference","description":"Google's generateContent wire priced from the request itself: the 402 quotes this exact body, from $0.001, with upto buyers settling actual usage. Use it when an agent built on the Gemini SDK needs a supported model paid per call without an API key.","url":"https://agent402.tools/v1/metered/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.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_q92HbJvKdosil-kMzvpqk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Run pay-per-call Google Gemini inference over x402 micropayments with no API key or signup required","exampleAgentPrompt":"Using Gemini Flash through Agent402, ask: what are the key differences between supervised and unsupervised learning? Pay per call with USDC — no API key needed.","exampleUseCases":[{"title":"Agentic tool-use reasoning loop","prompt":"I'm building an agent that needs to call Gemini with function declarations so it can decide when to use external tools — can you send a request to Agent402's metered Gemini endpoint with my tool schemas and the latest conversation turns, paying per call?"},{"title":"No-signup Gemini prototyping","prompt":"I want to try out Gemini 2.5 Flash right now without signing up for Google Cloud — can you call Agent402's pay-per-call Gemini endpoint with my prompt and a system instruction saying 'you are a concise technical assistant'?"},{"title":"Structured JSON output generation","prompt":"Send a Gemini request through Agent402 that returns a JSON object matching my schema — I need it to extract the product name, price, and category from this product description text, using responseMimeType application/json."}],"resultDescription":"A JSON object matching the Gemini generateContent response shape: an array of candidates each containing the model's generated content parts (text), a finishReason (e.g. STOP), plus usageMetadata with promptTokenCount, candidatesTokenCount, and totalTokenCount, and the modelVersion string.","failureModes":["Insufficient USDC balance or failed x402 payment results in 402 Payment Required","Invalid model path or unsupported model name returns 400 or 404","Malformed contents array (wrong role or parts structure) causes a 400 validation error","Exceeding maxOutputTokens or context window limits triggers a finishReason of MAX_TOKENS","Rate limiting on the underlying Gemini API may return 429","Missing or empty contents field returns a schema validation error"],"whenToPreferThis":"Choose this endpoint when you need Google Gemini inference inside an AI agent that uses x402 micropayment protocol, want zero-signup pay-per-call billing in USDC, or are building agentic workflows that require Gemini's function-calling or structured output features without managing Google Cloud credentials. Prefer this over direct Gemini API when operating in a trustless or multi-agent environment where per-call payment settlement is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T01:17:27.543Z","isFirstParty":false,"canonicalSlug":"agent402-metered-gemini-inference-9ab912a1"}