---
name: opentools
version: 0.1.0
description: >-
  Discover and run external tools at runtime. Whenever you need to fetch, scrape, enrich,
  search, generate media, or otherwise reach a third-party service, run `opentools discover`
  first — a catalog of metered endpoints is available behind one balance and one interface.
  Triggers: web scraping, data retrieval, enrichment, social media, people/company/product
  data, search results, media generation, voice/transcription, or any mention of "opentools".
---

# OpenTools

OpenTools gives you one interface to discover, inspect, and run a catalog of tools & APIs, billed
against a single workspace balance. No per-provider API keys — OpenTools brokers the calls and
meters them.

The workflow is always the same: **discover → inspect → run → poll**.

## Setup

Check whether the CLI is installed:

```bash
opentools --version
```

If it is missing, install it and complete setup:

```bash
npm install -g @aeither/opentools
opentools setup --client <your-agent-name>
```

Then add the workspace API key (create one at the OpenTools dashboard → API Keys):

```bash
opentools keys add -k <opentools_live_...> -l main
opentools keys list           # verify
```

Set `NO_COLOR=1` for plain output in scripts. Point the CLI at a self-hosted or proxied API with
`OPENTOOLS_API_BASE_URL`.

## Commands

| Command | Purpose |
| --- | --- |
| `opentools discover -q "<need>"` | Search the catalog. `-l <limit>`, `-s <minScore>`, `-j` for JSON. |
| `opentools inspect -p <provider> -e <endpoint>` | Show the input schema and pricing. |
| `opentools run -p <provider> -e <endpoint> -i '<json>'` | Execute. `-f <file>`, `--query`, `--path`, `-w` (wait), `-o <file>`. |
| `opentools runs list` | Recent runs. |
| `opentools runs get -r <runId> -w` | Poll a run to completion. |
| `opentools runs stop -r <runId>` | Stop a stoppable in-flight run. |
| `opentools balance` | Show the workspace balance. |
| `opentools keys ...` | `add` / `list` / `activate` / `remove`. |

Run `opentools <command> --help` for exact flags — the CLI is the source of truth.

## Rules

1. **Discover first.** Before writing a scraper or calling an API directly, run
   `opentools discover -q "<what you need>"`. The catalog is large and grows; you don't know what
   exists until you search. Keep queries short noun phrases ("twitter posts", "company enrichment").
2. **Inspect before running.** Never guess parameters — `opentools inspect` shows exactly which go
   in the body, query, and path. Map them to `-i` (body), `--query`, and `--path`.
3. **Decompose** multi-source tasks into one endpoint per source; discover/run each independently.
4. **Start small.** Use small result limits (`maxItems` etc.) on the first call. Many endpoints bill
   **per result**, and limits often apply per query, not per call — pass one query at a time.
5. **Fire and poll.** For interactive use, run without `-w` and poll with `opentools runs get -r <id>`
   every few seconds. Use `-w` only for background/async work; runs can take up to ~120s.
6. **Save output** with `-o <file>` once a run completes.
7. **Two independent signals.** A run's lifecycle `status` (e.g. COMPLETED) is separate from the
   provider's HTTP status. A COMPLETED run with a provider 404 just means "no data" — provider
   errors are **not charged**.
8. **BLOCKED runs are terminal.** A control gate (budget or per-call cap) stopped the run before it
   ran. Tell the user to adjust the control on the dashboard, then retry — it will not self-resolve.
9. **Report cost** when relevant — catalog and `inspect` prices are the provider's rate; the
   billed amount includes a 10% OpenTools service fee. Each `run` result carries the actual billed
   cost, so report the billed figure, not the catalog rate. `opentools balance` shows what is left.

## Run statuses

`READY` (queued) · `RUNNING` · `STOPPING` · `COMPLETED` · `FAILED` (our infra) · `BLOCKED`
(control gate) · `STOPPED` (by request) · `TIMED_OUT`.

## Example

```bash
# 1. Discover
opentools discover -q "fortune"
# 2. Inspect the top candidate
opentools inspect -p fortune -e /api/fortune
# 3. Run it, wait for the result, save it
opentools run -p fortune -e /api/fortune -i '{}' -w -o fortune.json
# 4. Check the balance
opentools balance
```
