Quick start
tinyx402 gives scripts and AI agents TinyFish web capabilities: search, page extraction, goal-driven browser automation, multi-source research, web-filled datasets and remote browsers. There are no API keys. Each request is paid with USDT on Whitechain through the x402 protocol.
1. Get a testnet wallet
Any EVM wallet works. Add Whitechain Sepolia (chain ID 1874, RPC https://rpc.testnet.whitechain.io) and get test USDT. See Whitechain + facilitator. You don't need WBT for gas, because the facilitator submits the transfer.
2. Try it in the browser
Open the playground, connect your wallet and press Run with x402. You sign one EIP-712 message per request, and the result, payment status and transaction hash appear side by side.
3. Call it from code
npm i @x402/fetch @x402/evm viemimport { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const paidFetch = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:1874", client: new ExactEvmScheme(account) }],
spendControls: {
allowedAssets: [{
network: "eip155:1874",
asset: "0xcedfB56113143d55b2358b8CFbB0dEB5Ad2f55a7",
maxAmountPerPayment: "100000",
}],
},
});
const res = await paidFetch("https://your-domain.com/api/v1/search?query=example");
console.log(await res.json());paidFetch behaves like fetch. When the server answers 402 Payment Required, it signs the payment, retries, and returns the paid response.
What it costs
| Endpoint | Price |
|---|---|
GET /api/v1/search | 0.01 USDT |
POST /api/v1/fetch | 0.015 USDT |
POST /api/v1/agent/run · /run-sse | 0.05 USDT |
POST /api/v1/research | 0.2 USDT (deep), 0.5 USDT (max) |
POST /api/v1/datasets | 0.02 USDT per target row |
POST /api/v1/browser | 0.03 USDT |
You are only charged when a request succeeds. Invalid input (400), failed agent runs, upstream failures (502/503) and anything else that returns a status of 400 or higher are never settled. Research and Datasets settle when the job is accepted, because they keep running in the background. Error codes →
Next
- Authentication via x402: why there is no API key
- Using the API directly: TypeScript, Python and curl
- For coding agents: a compact brief to paste into your agent