Prerequisites
- An AnyAPI key. Create one in the dashboard under API keys.
- A funded USD wallet.
run_apibills your wallet per successful request; discovery is free. - An MCP-capable client (Claude Code, Claude Desktop, Cursor, Codex, or any client that speaks Streamable HTTP).
The MCP surface is API-key only — session tokens are not accepted. Send your key as
Authorization: Bearer <your-key>. Discovery (list_apis, search_apis, get_api) works
without a key, so an agent can browse the catalog and read schemas before credentials are
set up; run_api and get_balance require authentication.Connect
- Claude Code
- Claude Desktop
- Cursor
- Codex
- Any MCP client
Add the server with the CLI:Confirm it registered:
Tools
The server exposes five generic tools. Discovery (list_apis, search_apis, get_api) is
free; only run_api touches your wallet. get_balance reports what’s left in it.
The MCP tools are a lightweight transport and projection over the same AnyAPI gateway
used by REST. The gateway owns input validation, provider selection, routing, failover,
pricing, health semantics, response normalization, and billing. Discovery tools return
those gateway-published facts and tolerate safe additions to the underlying catalog;
they do not recalculate relationships between prices, lanes, or failover.
list_apis — browse the catalog
list_apis — browse the catalog
Browse APIs as lightweight summaries, optionally filtered by category. Summaries carry
the SKU, name, category, provider, nested USD pricing, and failover status, but
no descriptions or schemas, so listing the whole catalog stays token-cheap.
To find an API by keyword (with descriptions), use
search_apis; for one API’s schemas, use get_api.InputReturns
scrapers, an array containing id, slug, name, category,
provider, nested pricing, failover, and optional heavy and
excludesCallerDelay. failover reports whether AnyAPI currently has an alternate
route. Descriptions, lanes, health, schemas, eligibility, and relevance are omitted.
Use search_apis for every ranked free-text query.search_apis — find an API by intent
search_apis — find an API by intent
Search APIs by meaning and keyword across name, slug, and description, returning matches with
their descriptions (schemas omitted). This is the targeted lookup: use it to find the
right SKU before reading its schema with
get_api.InputReturns
results with the list fields, including failover, plus description
and response-relative relevance, total before the limit, and ranking
(semantic or keyword). Lanes, health, schemas, and eligibility are omitted.get_api — inspect input and output schemas
get_api — inspect input and output schemas
Get the full definition of one API by SKU, including its normalized input and output
JSON schemas.Input
Returns the list fields, including
failover, plus description, anonymous lane
pricing, input/output JSON schemas, and optional tryEligible. Lane health is
omitted. Use the input schema to build a valid payload for run_api.run_api — execute an API
run_api — execute an API
Execute an API by SKU with a normalized input payload. Requires a valid AnyAPI key.
Billed to your USD wallet on success only.Input
The last three are opt-in response-budget controls — they keep a large result
from flooding your context window. They change only what is returned to you, never
what you are billed (
costUsd reflects the full result the API produced).Returns the normalized output, the serving provider (always AnyAPI),
costUsd, items (the number of results charged for), and replayed. Most APIs
are priced per result — baseUsd + perUnitUsd × items — so cap results (and cost)
with limit in your input; simple lookups are flat per request. Invalid input,
insufficient funds, and total upstream failure are not charged.Duplicate calls are not charged twice. MCP clients re-issue a tool call on
their own judgment: the model reads a result as truncated, the user re-runs the
turn, a conversation branch is replayed. AnyAPI derives a duplicate-protection
key automatically, with no argument for you to pass.Once AnyAPI admits that keyed run, it can continue synchronously in-process if
the MCP client disconnects, bounded by the normal execution deadline. The
disconnected request does not receive the eventual result. Repeat the same
sku_id and input (compared by meaning, so key order and formatting do not
matter):duplicate_call_in_progressmeans the original run is still working. Nothing has been charged yet; wait a few seconds and repeat the same call.- A completed replay returns the original
output,costUsd, anditemswithreplayed: true, without another provider run or charge.
get_balance — check your wallet
get_balance — check your wallet
Get the remaining wallet balance for the API key you authenticate with. Requires a
valid AnyAPI key; never charges.Input — none.Returns
balanceUsd, the remaining wallet balance in USD. Use it to confirm
there are funds before a run_api call, or to surface the balance to a user.How an agent uses it
A typical flow chains the tools - discover, inspect, run:1
Discover
The agent calls
search_apis with a query (for example, “instagram”) to find a matching
SKU and read its description. (Use list_apis instead to browse the whole catalog as
lightweight summaries.)2
Inspect
It calls
get_api with that sku_id to read the input schema and build a valid
payload.3
Run
It calls
run_api with the sku_id and input. AnyAPI routes to a provider,
normalizes the response, falls back automatically on error, and returns the result.Worked example
Discover Reddit APIs, inspect one, and run it. Tool results carry both a JSON text block andstructuredContent with these shapes:
list_apis returns the same identity and pricing fields without description or
relevance (and wrapped in scrapers). Neither tool returns lanes, health, or schemas,
so browsing and searching stay token-cheap. Reach for list_apis when you want to
enumerate rather than search.
This API’s pricing.from.model is flat, so its maximum is per request. failover
is the gateway’s authoritative routing fact; do not infer it from lanes. A linear
offer instead carries unit, baseUsd, perUnitUsd, and maxUsd. For example,
an API billed per result reports unit: "result"; the actual successful charge is
the base plus the per-unit amount, capped at maxUsd.
Errors
Tool failures come back as MCP tool errors with a short machine-readable prefix:
A completed lookup that returns a normalized empty result such as
found: false is not a
tool error. It is a successful, billable answer: the lookup ran and no matching entity was
found.