Skip to main content
AnyAPI ships a Model Context Protocol server so agents can discover and run any API in the catalog without bespoke integrations. Point your MCP client at one endpoint, authenticate with your AnyAPI key, and your agent gets a registry-driven tool surface that covers the entire catalog — no tool-per-API sprawl.

Prerequisites

  • An AnyAPI key. Create one in the dashboard under API keys.
  • A funded USD wallet. run_api bills 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

Add the server with the CLI:
Confirm it registered:

Tools

Discovery (list_apis, search_apis, get_api) is free; only run_api touches your wallet. get_balance reports what’s left in it, and report_bug and send_feedback let an agent tell us when something is wrong without leaving the session. 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.
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, latency, eligibility, and relevance are omitted. Use search_apis for every ranked free-text query.
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, latency, and eligibility are omitted.
Get the full definition of one API by SKU, including its normalized input and output JSON schemas.InputReturns the list fields, including failover, plus description, anonymous lane pricing, input/output JSON schemas, nullable latency, and optional tryEligible. Lane health is omitted. Use the input schema to build a valid payload for run_api.latency describes successful end-to-end requests after AnyAPI failover over the trailing 30 days:The value is null when there are no successful observations or metrics could not be read. A p99 is an observation, not a maximum or a recommended timeout. If excludesCallerDelay is true, add the waiting requested in your input when reasoning about wall-clock time.
Execute an API by SKU with a normalized input payload. Requires a valid AnyAPI key. Billed to your USD wallet on success only. Before choosing an MCP tool deadline, call get_api and inspect its observed latency.InputThe 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.For long-running work, run_api waits briefly and then returns a Request ID with a machine-actionable nextAction. Call get_request instead of repeating run_api.
Retrieve a durable Request by ID. This reads AnyAPI’s stored state and never repeats the paid operation.InputReturns the Request status and either its terminal result or a nextAction telling the agent when to call get_request again.
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.
Report a defect: a run_api call that returned wrong, empty, or malformed data for input you believe is valid, an error message that was misleading or unactionable, or a price or schema that looks wrong. Free; nothing is charged.Returns the stored report id. Pass request_id whenever you have one: it reaches the stored run and its upstream error body, so you never need to paste the payload. File the report and continue with the best alternative you have.
Send feedback that is not a defect: an API you wanted and could not find in the catalog, a field missing from a result you needed, a confusing part of the docs, or what would have made a task easier. Same fields as report_bug, and also free.

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, inspect observed latency before choosing a tool deadline, 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.
Because every API shares the same tools and one normalized schema convention, an agent that learns this flow once can use the entire catalog.

Worked example

Discover Reddit APIs, inspect one, and run it. Tool results carry both a JSON text block and structuredContent 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 maxUsd is what one request is billed. failover is the gateway’s authoritative routing fact; do not infer it from lanes. A linear offer instead carries unit, baseUsd, perUnitUsd, maxUsd, and maxPer1kUsd. 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. Every static offer publishes its maximum twice: maxUsd for one request and maxPer1kUsd for 1,000 of them, with failoverMaxPer1kUsd as the twin of failoverMaxUsd. Lane-level pricing objects carry maxPer1kUsd too. 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. Surface $0.90/1k req rather than $0.0009 per request, and read the published 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. Amounts that state what a specific call costs stay per request and are never scaled to 1,000: a price quote’s maxCostUsd and minCostUsd, the costUsd run_api returns, and the balanceUsd from get_balance.

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.
Pair the MCP server with the official agent skill — the skill teaches your agent the discover → inspect → run workflow and cost discipline; MCP provides the live tools. Need help? Reach out at support@getanyapi.com.