anyapi-cli with the anyapi binary.
Install
anyapi init installs the agent skills into detected agents, offers MCP
registration, and mints a free trial key if none is stored. For a global binary:
Commands
anyapi search takes any non-empty combination of a query, --category, and
--platform; ranking falls back from semantic to keyword. anyapi list only browses,
with an optional category. Both print the USD offer from discovery.
pricing.from is either a flat offer (model, unit: "request", maxUsd,
maxPer1kUsd) or a linear offer (model, unit, baseUsd, perUnitUsd, maxUsd,
maxPer1kUsd). pricing.failoverMaxUsd and pricing.failoverMaxPer1kUsd are the
greatest fallback ceiling, and failover reports whether AnyAPI currently has an
alternate route. The CLI shows these as the gateway publishes them and never derives
one from another. Run anyapi describe <sku> to see the complete offer, and see
Pricing for what each field means.
Authentication
The CLI resolves auth in this order:--api-keyflagANYAPI_API_KEYenvironment variable~/.anyapi/config.json- Interactive self-signup for commands that require auth
ANYAPI_API_KEY, not ~/.anyapi/config.json.
Sign in to an account
~/.anyapi/config.json and refreshes the token before it expires. This is
separate from anyapi connect, which upgrades a saved free trial and preserves its
trial receipt.
To store an existing dashboard key without OAuth:
Self-signup
anyapi signup calls the endpoint described in
Let your agent onboard itself:
~/.anyapi/config.json. The trial key carries a budget of about
$0.05, creates no account, and self-expires in 7 days.
Run output
By default,anyapi run writes JSON to:
costUsd, and item count. Use --json to print the
response to stdout, or -o path to choose the file. The CLI does not rewrite output.
For a long-running API, the CLI polls the Request until it finishes. Pass --no-wait to
return its Request ID immediately. If you press Ctrl-C after acceptance, the CLI prints the
anyapi requests wait <request-id> command to resume. Each CLI invocation uses a fresh
random idempotency key.
Context-budget flags
Use these flags when a result is too large for an agent’s context window:
They trim only what is returned.
costUsd still reflects the full result the API produced.
402 and upgrading past the trial
When the trial budget is spent, a run returns402 trial_cap_reached. To keep going,
connect a wallet (anyapi-cli >= 0.3.0):
anyapi login --api-key aa_live_....