AI agents that pay per call
Give an agent market data with no account and no key: free up to a budget, then USDC per call over x402.
An agent cannot fill in a signup form or keep an API key safe. With avee it does not have to:
- Free first. Every operation answers without a key, within a per-address budget.
- Then pay per call. Past the budget the same URL takes an x402 payment in USDC on
Base, Arbitrum or Solana, from $0.002 to $0.01 by the weight of the call. No account, no top-up, no
subscription.
https://api.preview.avee.tech/api/v1/.well-known/x402lists every price. - Every operation. Pairs, token safety briefs, candles, wallets, perps and oracle prices are all payable, at the paths the docs already show.
Pick a route
Agent with tools
Connect the MCP server; tool calls pay the same way.
Agent that writes code
Use an SDK with a payer; it pays only when the budget is spent.
MCP
claude mcp add --transport http avee https://mcp.preview.avee.tech/mcpTool calls count against the same free budget. Past it, a client that speaks the x402 MCP transport
sends Accept-Payment: x402 and receives a PaymentRequired result to sign, or pays up front in
_meta["x402/payment"]; the receipt comes back in _meta["x402/payment-response"]. Other clients:
Connect an agent.
SDK
Fund a wallet with a few dollars of USDC on Base, then give the client a payer. Without one the SDK
never pays and a spent budget is an ordinary 429.
import { AveeClient } from '@avee_tech/sdk';
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';
const account = privateKeyToAccount(process.env.PAYER_KEY as `0x${string}`);
const wallet = createWalletClient({ account, chain: base, transport: http() });
const client = new AveeClient({
baseUrl: 'https://api.preview.avee.tech/api/v1',
payer: {
networks: ['eip155:8453'],
async sign({ requirement: r }) {
if (BigInt(r.amount) > 10_000n) return null; // never more than $0.01 a call
const now = Math.floor(Date.now() / 1000);
const authorization = {
from: account.address, to: r.payTo, value: r.amount,
validAfter: String(now - 5), validBefore: String(now + r.maxTimeoutSeconds),
nonce: `0x${Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString('hex')}`,
};
const signature = await wallet.signTypedData({
domain: { name: String(r.extra?.name), version: String(r.extra?.version), chainId: 8453, verifyingContract: r.asset as `0x${string}` },
types: { TransferWithAuthorization: [
{ name: 'from', type: 'address' }, { name: 'to', type: 'address' }, { name: 'value', type: 'uint256' },
{ name: 'validAfter', type: 'uint256' }, { name: 'validBefore', type: 'uint256' }, { name: 'nonce', type: 'bytes32' } ] },
primaryType: 'TransferWithAuthorization',
message: { ...authorization, value: BigInt(authorization.value), validAfter: BigInt(authorization.validAfter), validBefore: BigInt(authorization.validBefore) },
});
return { payload: { signature, authorization } };
},
},
});
const brief = await client.tokenBrief('base', '0x…');
console.log(brief.verdict, client.lastResponse?.payment);sign may also return { header }, a finished PAYMENT-SIGNATURE from any x402 client library. Go
(avee.NewPayer) and Python (payer=) work the same way; see the SDKs.
What keeps an agent's wallet safe
- The payer sees the amount, asset, network and recipient before it signs, and can decline.
- A payment is settled only when the call answers
2xx; a malformed request is400and never charged. - The SDK never retries a paid request.
- A caller with an API key is never asked to pay.
Next: the agent quickstart, the x402 reference, or what to ask for in DEX and perps.