# Agent402 Gemini Pro – Pay-Per-Call Gemini API via x402

> Agent402 Gemini Pro – Pay-Per-Call Gemini API via x402 is a paid API for AI agents from agent402.tools, paid per call via x402, $0.1/call, status unknown (last checked 2026-10-15).

Calls Google Gemini models (e.g. gemini-2.5-flash) with full Gemini-native request format, billed per call via x402/USDC — no API key required.

## Facts

- Endpoint: POST https://agent402.tools/v1/pro/gemini?utm_source=zero.xyz
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-gemini-pro-pay-per-call-gemini-api-via-x402-9fb6055f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dheJP9wzRlOsk-pbpwBXI

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-gemini-pro-pay-per-call-gemini-api-via-x402-9fb6055f -d '<json body>'
```

Example prompt: Ask Gemini 2.5 Flash to summarize the following research abstract and return JSON: '<abstract text here>' — use the pay-per-call Gemini endpoint so I don't need to manage API keys.

## When to prefer this

Choose this endpoint when you need to call Google Gemini models (especially gemini-2.5-flash) using the native Gemini request format — including function calling, structured output via responseSchema, and system instructions — without registering for a Google API key. Ideal for AI agents that pay per inference using USDC/x402 micropayments and want zero-signup, keyless access to Gemini. Prefer it over OpenAI-compatible endpoints when your agent already constructs Gemini-native `contents` arrays with `role`/`parts` formatting.

## Known failure modes

- Payment not received or insufficient USDC balance — 402 Payment Required returned before generation
- Invalid or unsupported model name in path — 400 or 404 error
- Malformed `contents` array (missing role or parts) — 400 validation error
- Tool definitions with invalid parameter schemas — model may ignore tools or return error
- Token limit exceeded in generationConfig — response truncated or 400 error
- Network timeout on large outputs or slow model variants

## How this service works

Google's native generateContent wire on the pro 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.

## Output

Returns a Gemini-compatible JSON response with a `candidates` array (each containing content.role, content.parts[].text, and finishReason), the resolved `modelVersion` string, and `usageMetadata` with promptTokenCount, candidatesTokenCount, and totalTokenCount.

## 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-gemini-pro-pay-per-call-gemini-api-via-x402-9fb6055f/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)
