# Agent402 Metered Gemini Inference

> Agent402 Metered Gemini Inference is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Run pay-per-call Google Gemini inference over x402 micropayments with no API key or signup required

## Facts

- Endpoint: POST https://agent402.tools/v1/metered/gemini?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-metered-gemini-inference-9ab912a1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ATTbBkrkevh5vpmovl7FO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-metered-gemini-inference-9ab912a1 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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}]}"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-metered-gemini-inference-9ab912a1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
