DEV Community

Cover image for Connect Claude Code to 3,000+ APIs With One Sentence (Step-by-Step Guide)
OpenAny
OpenAny

Posted on

Connect Claude Code to 3,000+ APIs With One Sentence (Step-by-Step Guide)

In the first post we covered why your agent hits a wall the moment it needs real data. This one is hands-on: connecting Claude Code to OpenAny, making a first real call, and checking what it cost.

Your part: one sentence, plus one setup command in your own terminal.

What you need

  • Claude Code with terminal access.
  • Node.js 22+, which the OpenAny CLI requires (node --version).
  • A wallet or an email address for your OpenAny account. If you already have an OpenAny API key, you can use that instead.
  • A small balance. All calls draw from one shared balance.

Step 1: Give Claude Code the sentence

Open Claude Code in any project and type:

Read openany.si/AGENT.md and connect OpenAny
Enter fullscreen mode Exit fullscreen mode

That's the whole integration prompt. AGENT.md is written for agents. It tells Claude Code what to install, where the skill goes, and what it must never do with your credentials.

Steps AGENT.md tells Claude Code to take
Illustration (not a real session) of the steps AGENT.md tells Claude Code to take.

Step 2: What Claude Code does next

Following the published Claude Code recipe, your agent:

  1. Installs the OpenAny skill at .claude/skills/openany/SKILL.md, so future sessions know how to use it.
  2. Installs the CLI:
npm install -g openany-cli@latest --registry=https://registry.npmjs.org/
openany --version
openany --help
Enter fullscreen mode Exit fullscreen mode
  1. Checks your configuration with openany status --scenario call -j, reading the configured and missing fields. A passing local check only means the settings exist. It doesn't prove the key works yet.

Claude Code keeps its own main model. OpenAny doesn't replace it. It adds models, data, and tools the agent can call.

Step 3: Sign in without pasting secrets into chat

This is my favorite part. If you don't have a key yet, Claude Code asks whether you want to use a wallet or email, then hands you a command to run in your own terminal:

# Email: you enter only your email address
openany setup --scenario email

# Wallet: private key at a hidden prompt, plus a stable Agent ID like agent-main
openany setup --scenario wallet
Enter fullscreen mode Exit fullscreen mode

Then you reply "configured" and the agent continues:

  • Email: a six-digit code is sent (openany auth email send) and verified (openany auth email verify --code ...). Then a key is created.
  • First-time wallet: the agent creates a key (openany keys create --identity wallet --label agent-main -j), which registers your account and balance. Then it logs in with openany auth wallet -j.

The key is saved locally in ~/.config/openany/credentials.json (file mode 0600). The docs are explicit: never paste API keys, private keys, seed phrases, or codes into any AI chat. The agent is instructed never to ask for them. Already have a key? Run openany setup --scenario call and enter it at the hidden prompt.

Email setup in your terminal
Illustration (not a real session) of email setup in your own terminal, with generic values.

Step 4: Fund your balance

Add credits from the OpenAny dashboard at openany.si. See openany.si/pricing for the current options. Your agent can check your balance at any time:

openany balance -j
Enter fullscreen mode Exit fullscreen mode

Nothing tops up automatically by default. Agent-driven top-ups are opt-in, with limits you approve up front: per-payment cap, total cap, network, purpose, and expiry.

Step 5: Make your first real call

Ask for something real, in plain English:

Using OpenAny, find an API that returns the top Instagram posts
for the hashtag #coldbrew. Show me the price before you call it,
keep it under $0.05, and give me the results plus the request ID.
Enter fullscreen mode Exit fullscreen mode

Claude Code follows the same loop every time:

openany balance -j                                          # can we afford it?
openany discover -q "instagram hashtag top posts" -l 10 -j  # find candidates
openany inspect --id API_ID -j                              # schema, version, price
openany run --id API_ID --query '{...}' -j                  # the actual call
Enter fullscreen mode Exit fullscreen mode

API_ID comes from the live catalog, and the parameters come from inspect, so nothing is guessed. If several providers match, the agent should ask you which one to use.

Here's my real run. discover found Instagram Hashtag Top Posts. Before anything was spent, inspect showed the price and the one required field:

{
  "name": "Instagram Hashtag Top Posts",
  "method": "POST",
  "revision": 2,
  "price_usd": 0.0011,
  "required": ["hashtag"]
}
Enter fullscreen mode Exit fullscreen mode

That's about a tenth of a cent. I capped the call with max_cost_usd, so no route could charge more than one cent, and asked for three rows:

openany run --id 9cc6f928-f102-415e-aeec-db2fc21aaeb5 \
  --query '{"max_items":3,"max_cost_usd":"0.01"}' \
  -i '{"hashtag":"coldbrew"}' -j
Enter fullscreen mode Exit fullscreen mode

Response (trimmed):

{
  "status": 200,
  "requestId": "64fbd8a3-75c5-4692-99ca-0b19d6ddb2f7",
  "provider": "AnyAPI",
  "costUsd": 0.0011,
  "shown": { "shown": 3, "total": 24 },
  "posts": [
    { "caption": "Jangan sampe niatnya milih satu, malah k", "likes": 1148, "comments": 20, "views": 22174 },
    { "caption": "we, the people who don’t put sugar or sw", "likes": 503388, "comments": 3605, "views": 6663369 },
    { "caption": "Nah ini coldbrew pake espresso blend, be", "likes": 48, "comments": 7, "views": 1196 }
  ]
}
Enter fullscreen mode Exit fullscreen mode

That's live Instagram data, and I never opened an account with a scraping service.

Real output from a test run
Real output from our test run, trimmed with jq.

Tip: the CLI validates parameters before sending. My first try passed "max_items":"3" as a string. The CLI rejected it locally (Invalid type for max_items), so nothing was sent and nothing was charged.

The same CLI covers models too: openany models list, openany models prices, and openany models run with the operation that the model's listing publishes.

Step 6: Check what it cost

The response already includes costUsd: 0.0011 next to a requestId. To double-check, I compared the balance before and after:

{ "charged_usd": 0.0011 }
Enter fullscreen mode Exit fullscreen mode

The quoted price matched the charged price. There was no hidden fee and no monthly minimum.

Cost and balance difference
Real output from our test run: the response's cost and the balance difference.

Flow summary
Illustration summarizing the flow, using the real numbers from the run above.

For data and tool APIs, openany calls list and openany calls get --id REQUEST_ID show your call history. Model calls and overall usage also appear in the usage records in the dashboard.

Troubleshooting

  • configured: false: run setup on the same machine and account where Claude Code runs.
  • 401: check your API key. The agent shouldn't keep retrying with a bad one.
  • Email session expired: openany auth email refresh -j.
  • 402 / insufficient balance: add credits in the dashboard.
  • Timeout: don't repeat a paid request blindly. Check openany calls list first.
  • OPENANY_API_KEY is set in your shell: it overrides the key the CLI saved.
  • Just browsing? openany discover -q "..." --public and openany models prices --public work without a key.

Next steps

You've connected Claude Code, made a call, and seen the receipt. Now try something bigger. The first post has two full workflows (market research and a competitor price tracker) you can paste straight in.

Using Cursor, Codex, OpenClaw, or Hermes Agent? It's the same sentence. Each client installs the skill in its own folder (see the client recipes).

👉 openany.si · Docs · X: @openanysi

Keep your agent. Connect it to more.

Top comments (0)