Home › Docs › Adapters › Google ADK
Google ADK Adapter
agent402-google-adkFour meta tools (find, route, call, about) as FunctionTool instances for Gemini agents on Google's Agent Development Kit.
Install
npm install agent402-google-adk @google/adk zod
Quick start
import { agent402Tools } from "agent402-google-adk";
import { LlmAgent } from "@google/adk";
const tools = await agent402Tools(); // free tier: proof-of-work, no wallet
const agent = new LlmAgent({
name: "x402-agent",
model: "gemini-3.6-flash",
tools,
instruction: "Use agent402_find to discover the right tool, then agent402_call to invoke it.",
});
Paid tools
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const payClient = new x402Client();
registerExactEvmScheme(payClient, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, payClient);
// agent402_call pays wallet-only tools through this fetch
const tools = await agent402Tools({ fetch: payFetch });
Configuration
| Option | Type | Description |
|---|---|---|
fetch |
typeof fetch |
A payment-wrapped fetch (@x402/fetch for x402, mppx for MPP) that agent402_call uses for wallet-only tools. |
fetchImpl |
typeof fetch |
The plain fetch used for the unpaid lookups (find, route, about) and proof-of-work calls. Defaults to the global fetch. |
baseUrl |
string |
Point to a self-hosted Agent402 instance. |
// A payment-wrapped fetch (@x402/fetch for x402, mppx for MPP) that agent402_call uses for wallet-only tools.
agent402Tools({ fetch: payFetch })
// The plain fetch used for the unpaid lookups (find, route, about) and proof-of-work calls. Defaults to the global fetch.
agent402Tools({ fetchImpl: globalThis.fetch })
// Point to a self-hosted Agent402 instance.
agent402Tools({ baseUrl: "https://my-agent402.example.com" })
Works with
Google Agent Development Kit
LlmAgent
Gemini models