Skip to main content
This guide takes you from signup to a live response. You’ll create a key, top up your wallet, and run your first API.

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:
The agent reads the AnyAPI skill, sets up a key, and runs its first API on its own. Prefer to do it yourself? Follow the manual steps below.

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.
Prefer not to leave your terminal? Mint a free trial key with one request - no dashboard, no sign-in, no account:
The body is optional; label just tags the key. The response includes your aa_live_… key (shown once). It works immediately on a free trial budget of about $0.15, creates no account, and self-expires in 7 days. When the budget runs out, calls return 402 trial_cap_reached; run anyapi connect or open the dashboard to connect a wallet and keep going. See Let your agent onboard itself.
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:
Browse and search results report 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 optional Idempotency-Key header. Generate one key for a logical call and keep it until you receive a terminal response:
When AnyAPI honors the key, the synchronous run can continue in-process after your client disconnects, bounded by the normal execution deadline. The disconnected socket does not receive the eventual result. Retry the same SKU, query parameters, body, and key:
  • 409 idempotency_in_progress means the original run is still working. Wait a few seconds and retry the same request.
  • 200 with Idempotency-Replayed: true returns the original output, costUsd, and items without another provider run or charge.
  • Reusing the key with different request semantics returns 409 idempotency_conflict.
REST results remain replayable for 24 hours. If the continued run produces a replayable result, it charges normally exactly once even if the original client disconnected. Calls without an Idempotency-Key stay tied to the caller and are canceled on disconnect.

Check your balance

Top up any time from the dashboard — your wallet is a USD balance you draw down per request. Pay with a card, Link, crypto (USDC), or Apple / Google Pay; every method funds the same USD wallet.
Building an AI agent? Skip the per-endpoint wiring and connect the whole catalog over MCP instead — see Connect over MCP.