The fastest path: hand it to your coding agent
If you use a coding agent (Claude Code, Cursor, Codex, or any MCP-capable assistant), the simplest way to start is to give it one line. Paste this into your agent and it wires up AnyAPI for you, from key to first live call, without leaving your editor:Prerequisites
- An AnyAPI account — sign up at getanyapi.com.
- A terminal with
curl(or any HTTP client).
Get started
1
Create an API key
In the dashboard, open API Keys and create a new
key. Copy it somewhere safe — it’s shown only once.New accounts get a one-time $1 credit, so you can make your first calls before
topping up.
2
Make your first call
Every API is a single
POST to /v1/run/{sku}. Pass your key with the
X-API-Key header (or Authorization: Bearer) and the SKU’s normalized input
as the JSON body.Building an agent?
/v1/run/{sku} accepts optional query parameters that
shrink the response so a large result doesn’t flood your context window:
fields (keep only these keys), max_items (cap the rows), and summary
(outline only). They trim what’s returned, never what you’re billed. See the
MCP server page for details.3
Read the response
You get a normalized envelope.
output is the result, costUsd is what this
call cost you in real dollars, and items is the number of results you were
charged for (on per-result APIs).A legitimate “not found” is a success:
output is { "found": false, "data": null }.
You’re only charged when a call succeeds — failed calls cost nothing.Find an API
You don’t need to know SKUs ahead of time. Browse by category or use the dedicated ranked search endpoint:provider: "AnyAPI" and nested USD pricing.
pricing.from is the primary static offer, pricing.failoverMaxUsd is the maximum
fallback ceiling, and failover reports whether AnyAPI currently has an alternate
route.
These values come from the gateway. The gateway owns input validation, provider
selection, route and lane order, failover, pricing, health semantics, and billing.
Do not infer failover from the number of lanes or recompute pricing.from from lane
prices.
If you build a discovery wrapper, treat response objects as extensible. Read the
known fields your application needs, ignore safe additions, and preserve input and
output JSON Schemas as opaque objects. This lets the gateway add customer-safe
metadata without forcing a wrapper release.
The full catalog with typed schemas also lives in the API Reference.
Retry safely after a disconnect
Wallet-funded REST calls support an optionalIdempotency-Key header. Generate one key for a
logical call and keep it until you receive a terminal response:
409 idempotency_in_progressmeans the original run is still working. Wait a few seconds and retry the same request.200withIdempotency-Replayed: truereturns the originaloutput,costUsd, anditemswithout another provider run or charge.- Reusing the key with different request semantics returns
409 idempotency_conflict.
Idempotency-Key stay tied to the caller and are canceled on disconnect.