# Agent402 Gemini API Proxy

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

Proxies requests to Google Gemini language models via pay-per-call x402 micropayments — no signup or API keys required

## Facts

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

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-api-proxy-f666fbfc -d '<json body>'
```

Example prompt: Send this multi-turn conversation to Gemini 2.5 Flash and get a response — system instruction is 'You are a helpful assistant', user says 'Explain what x402 is in one sentence', and use up to 200 output tokens.

## When to prefer this

Choose this endpoint when you need to call Google Gemini (especially Gemini 2.5 Flash) without a Google API key or account, want to pay per call in USDC via x402 micropayments, are building an autonomous agent that needs LLM access with no pre-registration, or want native Gemini API compatibility (same request/response shape) with metered billing. Prefer this over OpenAI-compatible endpoints when you specifically need Gemini's multimodal input format, structured output with responseSchema, or Gemini's native tool/function-calling interface.

## Known failure modes

- Payment not attached or insufficient USDC — returns HTTP 402 requiring x402 payment
- Invalid model path or unsupported model name — returns error from upstream Gemini
- Malformed contents array (missing role or parts) — upstream validation error
- Token limit exceeded for input — finishReason may be MAX_TOKENS
- Tool declaration schema malformed — function calling may fail silently or error
- Rate limit or quota exhaustion on upstream Google endpoint — 429 or 503 propagated

## How this service works

Google's native generateContent wire on the base 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-format JSON response containing an array of candidates, each with a content object (role: model, parts with text), a finishReason (e.g. STOP), the modelVersion string, and usageMetadata showing 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-api-proxy-f666fbfc/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)
