Pay an API with x402 — in about ten lines
x402 is HTTP 402 put to work: a server answers 402 Payment Required
with the exact price, the client signs a stablecoin payment and repeats the same request.
No account, no API key, no invoice.
These examples call DexL Agents, an x402 gateway (chat models, speech, web search and crawl, on-chain reads, FX rates, NLP tools). Everything here works against any x402 server — only the URL changes.