Paying for API calls in USDC from an MCP agent
On this page
An agent pays for an API call in USDC by answering an HTTP 402 Payment Required response with a signed transfer. The server states the price, the agent signs the payment from a funded wallet, and the retried request returns the data.
What USDC payment means for an API call
USDC is a stablecoin pegged to the US dollar. A paid API call settles in USDC instead of a card charge or a prepaid account balance.
Per-call pricing removes the need for a monthly plan. The agent pays for each request it makes, and it pays nothing for requests it skips.
How the x402 payment flow works
The x402 pattern uses the HTTP 402 status code to request payment before it returns data. The client handles the exchange in four steps.
- The agent sends a normal request to the endpoint.
- The server answers with status 402 and a payment requirement that names the price and the accepted token.
- The agent signs a USDC transfer for that amount and retries the request with the payment attached.
- The server verifies the payment and returns the response body.
The agent code does not change between free and paid endpoints. Only the payment step adds a round trip.
What to check before you pick a gateway
Start with the network. Confirm that the gateway settles on the chain where your wallet already holds USDC. A mismatch blocks the payment before the first call succeeds.
Next, read the price for each tool. Prices in the catalog range from 0 to 29.99 per call, so set your budget against the tools your agent will use.
Then check how the gateway reports failed payments. A clear error code lets the agent stop and report the cause instead of retrying in a loop.
Give your agent paid tools through MCP
An MCP server exposes each paid endpoint as a named tool. The agent calls the tool, and the gateway handles the 402 exchange behind the call.
Keep the wallet key on the agent host. Do not place the key in a prompt, a config file committed to git, or a shared log.
Set a spending cap for each session. A cap limits the damage when a faulty loop repeats a paid call many times.
Where this approach has limits
Each paid call makes two requests instead of one. Latency rises on every call, so batch requests where the endpoint supports batching.
Stablecoin settlement does not settle tax or compliance duties in your jurisdiction. Confirm those obligations with a qualified adviser before you run agents with real funds.
We reviewed no public comparison of gateway prices for this page. Compare the price field on each gateway before you commit.
Live pricing — developer
Data source: live tool catalog snapshot, fetched 2026-11-11.
Chart data as a table
| Tool | Price per call | Cache-hit price |
|---|---|---|
| Usage Time Series | $0.0 | $0.0 |
| Per-Tool Usage Breakdown | $0.0 | $0.0 |
| Usage Summary | $0.0 | $0.0 |
| Discover Tools | $0.0 | $0.0 |
| Batch Tool Calls | $0.0 | $0.0 |
| Tool Quality Metrics | $0.0 | $0.0 |
| Tool Quality Rankings | $0.0 | $0.0 |
| List Programming Languages | $0.001 | $0.0001 |
| Check CVE ID Reservation Status | $0.001 | $0.0001 |
| Security Advisories (deps.dev) | $0.001 | $0.0001 |
| Dependency Tree (deps.dev) | $0.001 | $0.0001 |
| Package Info (deps.dev) | $0.001 | $0.0001 |
| Tool | Provider | Price/call | Cache-hit |
|---|---|---|---|
| Usage Time Series | account | $0 | $0 |
| Per-Tool Usage Breakdown | account | $0 | $0 |
| Usage Summary | account | $0 | $0 |
| Discover Tools | apibase | $0 | $0 |
| Batch Tool Calls | platform | $0 | $0 |
| Tool Quality Metrics | platform | $0 | $0 |
| Tool Quality Rankings | platform | $0 | $0 |
| List Programming Languages | judge0 | $0.001 | $0.0001 |
| Check CVE ID Reservation Status | cve-mitre | $0.001 | $0.0001 |
| Security Advisories (deps.dev) | depsdev | $0.001 | $0.0001 |
| Dependency Tree (deps.dev) | depsdev | $0.001 | $0.0001 |
| Package Info (deps.dev) | depsdev | $0.001 | $0.0001 |
Connect via MCP
Data source: gateway design, no measured values.
$ curl -X POST https://apibase.pro/api/v1/tools/account.timeseries/call \
-H "Content-Type: application/json" -d '{"params": {}}'FAQ
Can an AI agent pay for API calls in USDC?
Yes. The agent signs a USDC transfer when a server returns HTTP 402. The client library or gateway handles the signing. The agent receives the data after the payment clears.
Does a USDC API setup need a subscription?
No. Per-call pricing charges only for the requests the agent makes. Check the price field for each tool before the first run.
Which network should the wallet use?
Use the network the gateway lists as accepted. USDC exists on several chains, and a wallet on the wrong chain cannot complete the payment.
How do I stop an agent from overspending?
Set a per-session spending limit in the wallet or the client. The limit stops a looping agent before it drains the balance.
Recommended next step
- STEP 1/2 Connect your MCP client
- STEP 2/2 Browse the full catalog
Related guides
Written with AI assistance from APIbase's published documentation and public data; checked automatically against them. Corrections: https://apibase.pro/
Published: 2026-11-11Source: live apibase.pro catalog snapshot