Pay per call with x402
Call any endpoint without an account. Your client pays for the single call in USDC on Solana, and the data comes back in the same request. Built for autonomous agents: no signup, no API key, no subscription.
How a paid call works
- Call the endpoint. With no API key and no payment, it answers
402 payment_requiredand describes the price. - Your client signs a USDC transfer for that amount and retries the request with the payment attached.
- We verify and settle it through the Coinbase x402 facilitator, then return the data. The facilitator pays the Solana network fee, so your wallet needs USDC only.
- Errors are free. A call is settled only when it returns data, so a 404 costs nothing.
Any x402 client library does all four steps for you. Both protocol versions work: V2 (PAYMENT-REQUIRED and PAYMENT-SIGNATURE headers) and V1 (accepts in the body, X-PAYMENT header).
Price per call
| Price | Endpoint |
|---|---|
| $0.02 | GET /v1/tokens/:mint — full snapshot: score, holders, bundles, KOLs, cohorts, ratings. |
| $0.01 | Every other endpoint: token lists, token trades, trader stats, deployer tokens. |
Paid in USDC (mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v) on Solana mainnet. Live prices for every route are in openapi.json. WebSocket streams are Pro only — per-message payments do not fit a live feed.
The 402 challenge
The offer arrives twice, so clients of either version can read it: base64 JSON in the PAYMENT-REQUIRED header (V2) and in the body (V1). The body also carries the Pro upgrade link, in case a human is reading.
$ curl -i https://api.cookin.fun/v1/tokens/<mint>
HTTP/1.1 402 Payment Required
payment-required: eyJ4NDAyVmVyc2lvbiI6MiwiYWNjZXB0cyI6W3sic2NoZW1lIjoiZXhhY3QiLCJ...
content-type: application/json
{
"error": {
"code": "payment_required",
"message": "Payment required. Activate Pro on your API keys page, or pay for this call with x402 (USDC on Solana).",
"upgrade_url": "https://cookin.fun/account/api-keys"
},
"x402Version": 1,
"accepts": [
{
"scheme": "exact",
"network": "solana",
"maxAmountRequired": "20000",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"payTo": "HpZ7TcKzX5GQ1jbFFYB3Npq321g8UrmsnaTKVNicu1Dv",
"resource": "https://api.cookin.fun/v1/tokens/<mint>",
"maxTimeoutSeconds": 60,
"extra": { "feePayer": "..." }
}
]
}
Client example
Node, with the official x402 client. The wallet needs USDC and nothing else.
// npm i @x402/fetch @x402/svm @solana/kit @scure/base
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { registerExactSvmScheme } from "@x402/svm/exact/client";
import { createKeyPairSignerFromBytes } from "@solana/kit";
import { base58 } from "@scure/base";
const signer = await createKeyPairSignerFromBytes(base58.decode(process.env.SOLANA_KEY));
const client = new x402Client();
client.setSpendControls({ maxAmountPerPayment: "$0.05" });
registerExactSvmScheme(client, { signer });
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
// 402 -> sign -> retry -> data, all inside this one call.
const res = await fetchWithPayment("https://api.cookin.fun/v1/tokens/<mint>");
const { data } = await res.json();
console.log(data.ratings); // { score: "green", bundle: "red", ... }
Python and Go clients exist too; any of them work, because the server speaks the standard protocol.
Rate limits without a key
Paid calls get the Pro ceiling of 600 requests per minute, counted per IP. Requests that carry no payment are capped at 60 per minute per IP, which is enough to read the price and pay. See Rate limits.
From Claude or Cursor, with no code
These endpoints are also eight MCP tools, two ways. Remote, with nothing to install:
https://api.cookin.fun/mcp
A tool call with no payment answers with the x402 quote. Sign it and call again with the payment in the x_payment argument, or send a Pro key in the Authorization header.
Or locally, where the server signs payments for you from the wallet in SOLANA_KEY. See SDKs for the config.
npx -y @cookinfun/mcp
Finding Cookin automatically
Every 402 carries discovery metadata, so agent catalogs can index the endpoints without us registering anything by hand. Agents on Coinbase's Bazaar find Cookin by searching it; the machine-readable description of every route lives at api.cookin.fun/openapi.json.
When Pro is cheaper
Pay per call for occasional lookups. Past roughly a few thousand calls a month, Pro (1 SOL per 30 days) costs less and adds 600 requests per minute plus the WebSocket streams. A Pro key and x402 can be used from the same client: a key is never charged per call.