Getting started
Sign up, get an API key, top up credits, and make your first paid API call in about five minutes.
1. Install the CLI (optional but recommended)
The fastest path to working calls is the CLI. It handles auth, MCP client setup, and credit purchases without any wallet plumbing on your end.
# install globally
npm install -g @apihubio/cli
# or run on demand via npx
npx @apihubio/cli --helpPrefer to skip the CLI? You can also use the dashboard at apihub.io/dashboard for everything described below.
2. Get an API key
You need an API key to authenticate any paid call. Two ways to get one:
npx @apihubio/cli registerOr autonomously via wallet signature (no email, no human):
# 1. Get the challenge message
curl https://api.apihub.io/v1/register/challenge
# 2. Sign with your EVM wallet, then POST the signature
curl -X POST https://api.apihub.io/v1/register \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "0xYourWallet",
"signature": "0xSignedMessage"
}'See Agents: API keys for full details on both flows.
3. Top up credits
Credits are USDC pre-paid on Base. Each API call debits your credit balance with zero gas. Minimum top-up is $5.
npx @apihubio/cli topup 10The CLI opens a browser to complete payment with your wallet. Other top-up paths (browser-only, MCP tool, raw x402) are described in Credits.
4. Make your first paid call
Call an onboarded service through the proxy. The example below uses the Currency Exchange Rates service at $0.0005 per call.
curl https://proxy.apihub.io/exchange-rates/latest/USD \
-H "Authorization: Bearer ahk_your_key_here"Response includes the upstream JSON plus headers showing what you paid:
x-apihub-payment-protocol: credit
x-apihub-charged: 500
x-apihub-credit-balance-remaining: 9999500
x-apihub-latency-ms: 4915. (Optional) Connect from Claude Desktop or Cursor
The CLI can auto-configure your MCP client so any AI assistant you use can discover and call APIs through APIHub:
npx @apihubio/cli installDetects installed MCP clients and writes the config for you. See MCP integration for client-specific setup details.
Done
- Calling APIs for the full payment flow (credits, x402, free tier, external services)
- CLI reference for every CLI command
- API reference for every public endpoint
- Provider onboarding if you want to publish APIs too