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.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: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 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.