LlamaIndex Tools Integration: AnyAPI
AnyAPI is one key and one USD wallet in front of hundreds of data and scraping APIs: Reddit, Instagram, TikTok, YouTube, LinkedIn, Google search and maps, Amazon, and clean JSON from pages that block bots. There is no subscription; you are billed per request in USD.
This package exposes AnyAPI to LlamaIndex as a single AnyAPIToolSpec.
Install
pip install llama-index-tools-anyapi
Set ANYAPI_API_KEY, or pass api_key= to the tool spec. Get a key at
getanyapi.com.
Usage
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.anyapi import AnyAPIToolSpec
agent = FunctionAgent(
tools=AnyAPIToolSpec().to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("What is trending on Reddit right now?"))
The tools also work on their own:
spec = AnyAPIToolSpec()
spec.search_apis("trending posts on reddit", limit=3)
spec.get_api("reddit.trending_posts") # read the strict input schema
spec.run_api("reddit.trending_posts", {"limit": 2})
Every tool has an awaitable twin (asearch_apis, aget_api, arun_api, and
so on) backed by AsyncAnyAPI, so await tool.acall(...) talks to AnyAPI
asynchronously rather than running the blocking client on a thread.
A runnable script is in examples/basic_usage.py.
The five tools
AnyAPI publishes hundreds of SKUs. One tool per SKU would exhaust any agent's context, so this spec ships the AnyAPI MCP server's discovery-then-run loop instead.
| Tool | Charges? | What it does |
|---|---|---|
search_apis |
no | ranked search over the catalog, descriptions kept, schemas omitted |
list_apis |
no | browse summaries, optionally filtered by category |
get_api |
no | one API in full: strict input schema, output schema, per-lane USD pricing, 30-day latency |
run_api |
YES | execute one SKU with a normalized input payload |
get_balance |
no | remaining wallet balance in USD |
Search and browse results carry no input schema. Call get_api for an API
before your first run_api on it and build the input from the schema it
returns: every input schema is strict, so an invented field name fails the call.
Prices
Every static price is published in both denominations and neither is derived
from the other. maxUsd is what one request is billed; maxPer1kUsd is the
same price per 1,000 requests. Quote the per-1k figure to a person, and never
multiply a price yourself. A per-call charge comes back as costUsd on the run
result.
There is no quote tool. get_api already publishes pricing.from.maxUsd, the
most a first-choice run is billed, and pricing.failoverMaxUsd, the ceiling for
any run of that API, so an agent can bound its spend before calling.
Departures from the AnyAPI MCP server
The tool descriptions are the MCP server's own wording, because it already encodes what agents get wrong. Three things differ here:
- there is no quote tool, for the reason above;
- search results carry no
heavymarker; - the MCP server names its tools
anyapi_search_apis,anyapi_get_apiand so on, and the shared wording is written that way. Here the tool spec is the namespace, so the tools aresearch_apis,list_apis,get_api,run_apiandget_balance, and theanyapi_prefix is stripped from the descriptions when they are bound, so every tool a description names is one you can call.
License
MIT. See the LICENSE file at the root of the repository.
Metadata
Release files for llama-index-tools-anyapi 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| llama_index_tools_anyapi-0.2.0.tar.gz | 8.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_tools_anyapi-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.4 kB
Release files / llama_index_tools_anyapi-0.2.0.tar.gz
| Download URL | llama_index_tools_anyapi-0.2.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e6af19b1d69179c8e0cb2b5b639a51b991babc67d4dac3123a5f2171f1b1f48
|
|
BLAKE2b-256 checksum How to use checksums |
459100138632bb8547244797939aa54492be4e850289abe47e1987441f9d4002
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logRelease files / llama_index_tools_anyapi-0.2.0-py3-none-any.whl
| Download URL | llama_index_tools_anyapi-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ead85ff99afb0f2e4014be6272241a2ea355cc0e8bdf90ff69189392f6908452
|
|
BLAKE2b-256 checksum How to use checksums |
f403287bc8eccd4125fbef677efb12af557a57bedb9838d65711d3aeabe2ef2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logSecurity for llama-index-tools-anyapi 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for llama_index_tools_anyapi-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.