Pay per call
Every docs page as Markdown: /docs/llms.txt
Call any endpoint without an API key: pay $0.004 a call in USDC on Base with x402.
- Call an endpoint with no apiKey. It answers 402 with its price in the PAYMENT-REQUIRED header.
- An x402 client signs a USDC payment from your wallet and sends the call again with it in PAYMENT-SIGNATURE.
- The answer is the same as with a key. The payment settles only when the call succeeds, and the receipt comes back in PAYMENT-RESPONSE.
- Your account endpoints need an API key.
pip install "x402[evm,httpx]"import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import wrapHttpxWithPayment
from x402.mechanisms.evm.exact import ExactEvmScheme
from x402.mechanisms.evm.signers import EthAccountSigner
client = x402Client()
client.register("eip155:8453", ExactEvmScheme(signer=EthAccountSigner(Account.from_key(os.environ["WALLET_KEY"]))))
async def main():
async with wrapHttpxWithPayment(client) as http:
r = await http.get("https://tradytics.com/api/public/v1/options/flow?symbol=NVDA&limit=5")
print(r.json())
asyncio.run(main())- Clients for TypeScript, Go and more are on x402.org. Every endpoint is also listed in the x402 Bazaar, where agents find paid APIs.