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.The example below uses the published tiktok.profile input. When you integrate a different SKU, fetch GET /v1/apis/{sku} first and construct the body from its inputSchema. Do not transfer fields from another API or retry invalid input with guessed aliases. That selected-SKU response also includes observed latency for choosing your HTTP client deadline.
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. To browse by eye, every platform has a catalog page listing its endpoints, schemas, and USD prices: start at the full catalog, or jump straight to a platform such as Instagram, TikTok, LinkedIn, or Google Maps. From code, browse by category or use the dedicated ranked search endpoint:
Treat inputSchema as the request contract. Send only properties it declares. A field used by one search API, including limit, cursor, page, or sort, may be invalid for another. 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. Each of those maximums arrives in two denominations. pricing.from.maxUsd and pricing.failoverMaxUsd are what one request can be billed; pricing.from.maxPer1kUsd and pricing.failoverMaxPer1kUsd are the same ceilings per 1,000 requests. Per 1,000 requests is the denomination AnyAPI quotes customers in, because most of the catalog costs a fraction of a cent per call and per-request figures cannot be compared by eye. Show $96.60/1k req rather than $0.0966 per request, and read the published per-1k field instead of multiplying maxUsd, which drifts in floating point (0.0966 * 1000 is 96.60000000000001 in most languages). baseUsd and perUnitUsd have no per-1k twin, because they are charged per billable item inside one call. The costUsd on a completed run and your wallet balance stay per request. 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.

Choose request deadlines from observed latency

Before you set an HTTP client timeout, inspect the selected SKU rather than using one short timeout for the whole catalog:
latency reports trailing-30-day p50Ms, p95Ms, p99Ms, and sample values from successful end-to-end requests after AnyAPI failover. Its basis is service_time_excludes_caller_requested_delay. If excludesCallerDelay is true, your wall-clock time also includes the waiting requested in your input. latency is null when there are no successful observations or metrics could not be read. A p99 value is an observation, not a maximum or a recommended timeout. Browse and search responses omit latency; fetch the selected-SKU detail before choosing a deadline.

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 on Stripe’s secure hosted checkout page; enabled methods fund the same USD wallet with no AnyAPI top-up fee. The balance changes only after the verified payment settles.
Building an AI agent? Skip the per-endpoint wiring and connect the whole catalog over MCP instead — see Connect over MCP.