81trust / 100

Nano Gemini

by Gemini generateContent (nano in AI models & inference

x402 APIPassing, checked 36 min ago

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

POST https://agent402.tools/v1/nano/gemini

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
186 ms typical, 186 ms slowest 5%
Last check
36 min ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/v1/nano/gemini" \
  -H "content-type: application/json" \
  -d '{"contents":[{"parts":[{"text":"Summarize x402 in one sentence."}],"role":"user"}],"generationConfig":{"maxOutputTokens":256}}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fv1%2Fnano%2Fgemini
const res = await pay("https://agent402.tools/v1/nano/gemini", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"contents":[{"parts":[{"text":"Summarize x402 in one sentence."}],"role":"user"}],"generationConfig":{"maxOutputTokens":256}}),
});
console.log(await res.json());

Example input

{
  "contents": [
    {
      "parts": [
        {
          "text": "Summarize x402 in one sentence."
        }
      ],
      "role": "user"
    }
  ],
  "generationConfig": {
    "maxOutputTokens": 256
  }
}

Example output

{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "x402 is an HTTP-native way for agents to pay per request with USDC."
          }
        ],
        "role": "model"
      },
      "finishReason": "STOP",
      "index": 0
    }
  ],
  "modelVersion": "google/gemini-3.5-flash-lite",
  "usageMetadata": {
    "candidatesTokenCount": 18,
    "promptTokenCount": 14,
    "totalTokenCount": 32
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
36 min agoPassed402380 ms$0.003
4 h agoPassed402186 ms$0.003
9 h agoPassed402181 ms$0.003