@apihubio/cli
v0.3.7
Published
APIHub CLI - call x402 APIs with prepaid credits, no wallet required
Downloads
871
Maintainers
Readme
@apihubio/cli
Call x402 APIs with prepaid credits. No wallet required.
Install
npm install -g @apihubio/cli
# or use on-demand
npx @apihubio/cli <command>Quick start
# 1. Sign up and save your API key
apihub register
# 2. Top up credits ($5 minimum)
apihub topup 10
# 3. Call a native APIHub service (payment drawn from credits)
apihub call https://proxy.apihub.io/global-weather/current?city=NYC
# 4. Wire up Claude / Cursor / Codex to use APIHub via MCP
apihub installBrowse the marketplace at apihub.io/marketplace to discover native services and external x402 APIs you can call the same way.
Commands
| Command | What it does |
|---|---|
| register | Open the browser to sign up, save API key to ~/.apihub/config.json |
| balance | Show prepaid credit balance |
| topup <usd> | Open checkout to buy credits (minimum $5) |
| search [query] | Search the marketplace for x402 services |
| call <url> | Make a paid call through APIHub's proxy; credits cover x402 |
| add <url> | Register an x402 service URL to your toolset |
| install [target] | Wire up MCP config for claude, cursor, codex, claude-code |
| init [dir] | Scaffold a starter project: claude, openai, langchain, python, node-ts |
All commands support -h / --help for detailed usage.
call options
apihub call <url> [-X POST] [-H 'Header: Value']... [-d '{"body":"..."}'] [--json]Environment
| Variable | Description |
|---|---|
| APIHUB_API_KEY | Override stored API key (useful for CI) |
| APIHUB_API_URL | Override API base (default https://api.apihub.io) |
| APIHUB_PROXY_URL | Override proxy base (default https://proxy.apihub.io) |
Why not use a wallet directly?
You can! Every x402 service is callable via @x402/fetch with your own wallet. APIHub is the credits-based alternative:
- No wallet, no gas - deposit USDC once, spend it across any x402 API
- Gasless calls - credits draw down server-side, no per-call signing
- Unified billing - one dashboard, one invoice, clear spend history
- Works with AI tools - MCP server integrates with Claude, Cursor, Codex
License
MIT
