81trust / 100
Metered Gemini
by Gemini generateContent (metered in AI models & inference
x402 APIPassing, checked 2 h ago
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.
POST https://agent402.tools/v1/metered/gemini
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 185 ms typical, 185 ms slowest 5%
- Last check
- 2 h 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/metered/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%2Fmetered%2Fgemini
const res = await pay("https://agent402.tools/v1/metered/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
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 2 h ago | Passed | 402 | 197 ms | $0.0019 |
| 7 h ago | Passed | 402 | 185 ms | $0.0019 |