Paying for API calls in USDC from an MCP agent

developer2026-11-11

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

Price per call, developer tools Horizontal bar chart of the price per call and the cache-hit price, in US dollars, for 12 developer tools. The same values are in the table below the chart. Price per call Cache-hit price $0.0 $0.0005 $0.001 Usage Time SeriesUsage Time Series $0.0 $0.0 Per-Tool Usage BreakdownPer-Tool Usage Breakdown $0.0 $0.0 Usage SummaryUsage Summary $0.0 $0.0 Discover ToolsDiscover Tools $0.0 $0.0 Batch Tool CallsBatch Tool Calls $0.0 $0.0 Tool Quality MetricsTool Quality Metrics $0.0 $0.0 Tool Quality RankingsTool Quality Rankings $0.0 $0.0 List Programming LanguagesList Programming Languages $0.001 $0.0001 Check CVE ID Reservation Stat…Check CVE ID Reservation Status $0.001 $0.0001 Security Advisories (deps.dev)Security Advisories (deps.dev) $0.001 $0.0001 Dependency Tree (deps.dev)Dependency Tree (deps.dev) $0.001 $0.0001 Package Info (deps.dev)Package Info (deps.dev) $0.001 $0.0001 US dollars per call
Price per call for developer tools, cheapest first.

Data source: live tool catalog snapshot, fetched 2026-11-11.

Chart data as a table
ToolPrice per callCache-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
ToolProviderPrice/callCache-hit
Usage Time Seriesaccount$0$0
Per-Tool Usage Breakdownaccount$0$0
Usage Summaryaccount$0$0
Discover Toolsapibase$0$0
Batch Tool Callsplatform$0$0
Tool Quality Metricsplatform$0$0
Tool Quality Rankingsplatform$0$0
List Programming Languagesjudge0$0.001$0.0001
Check CVE ID Reservation Statuscve-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

How a tool call worksAn AI agent sends a tool call to the APIbase gateway. The gateway checks payment, calls the provider API, and returns the JSON result to the agent.Your agentAPIbase gatewayProvider API1. tool call2. paid call3. JSON result flows back to the agent
Diagram: the path of one tool call.

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.

  1. STEP 1/2 Connect your MCP client
  2. STEP 2/2 Browse the full catalog

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