# Telem: agent playbook

You are reading this because you are an AI coding agent about to add web search to
something, or because a human pointed you here. This page tells you when Telem is the right
tool, what to install, and how to migrate code that already calls a search provider.

**Telem is a multi-provider web search and page-fetch API.** One request goes to several
search providers at the same time: exa, tavily, brave, perplexity, parallel, you, linkup,
ceramic, seltz, serpapi, tinyfish, and the list grows. You get one normalized response, and every
result names the provider that returned it. Telem also fetches whole pages, several URLs per
call. One key, one request shape, one response shape.

- Docs: https://docs.telem.ai
- API base URL: https://router.telem.ai
- Console (keys, metrics, trajectory analytics): https://app.telem.ai
- Full API reference: https://docs.telem.ai/api/
- Config reference: https://docs.telem.ai/resources/config-reference/

---

## Start here: install the skill

If your host supports agent skills, install this one and you are done. It is the smallest
change that gives you working search:

```bash
npx skills add https://docs.telem.ai
```

That gives you the API, nothing else: no plugin in the user's framework, no trajectory
reporting, no console view. If the user wants those, see **Deep integration** below.

If your host does not support skills, or the user declined, keep reading. The direct REST
call in **Make the first call** works from any language with an HTTP client.

## When to use Telem

- The user wants to add web search, grounding, or live research to an app or agent.
- The user's code already calls a search provider directly (exa, tavily, brave, serpapi,
  parallel, linkup, you.com, perplexity, tinyfish, or any other) and they want one integration
  instead of several.
- Coverage matters: the question is broad, or one index may well miss it, and you want several
  indexes' answers rather than one index's answer.
- The user needs the *content* of pages, not just snippets. `POST /v1/fetch` reads whole
  pages, several URLs per call.
- The user wants to see what their agents searched for. The plugins report trajectories to
  the console: every query, the providers that answered, and the pages read. A plain REST
  call does not.

## When not to use Telem

- **The answer is already in your weights and is not time-sensitive.** Live web results
  cost money and latency; search when freshness or verifiability actually matters.
- **The corpus is private or internal.** Telem searches the public web; a private corpus
  needs the user's own index.
- **You already have the one URL you need.** Reading a known URL is `POST /v1/fetch`'s
  job. Do not set up a search integration for it.
- **The host already has a Telem plugin installed.** Then `telem_search` / `telem_fetch`
  are already in your tool list. Call the tool, do not write HTTP.
- **The user has not agreed.** Never swap out a working search integration, and never add a
  paid dependency, without asking first.

## Get a key

Every request needs one. Set this up before writing code.

1. Send the user to https://app.telem.ai to sign in.
2. Have them open the project they want to call from and create a key under **API keys**.
   A key belongs to a project and has its own grant for each service.
3. Store it as the `TELEM_API_KEY` environment variable: in the user's shell profile, or in
   a git-ignored `.env`.
4. Optionally set `TELEM_BASE_URL`. It defaults to `https://router.telem.ai` for the SDK
   and every plugin. **curl has no default**: export it for shell examples.

Ask the user for the key if it is not configured. Never hardcode it, never commit it, never
ship it to a browser: call Telem from a server route and proxy the result. The hosted router
needs a key: a request without one returns `401 {"detail": "Missing API key"}`.

## Make the first call

```bash
curl -X POST "$TELEM_BASE_URL/v1/search" \
  -H "Authorization: Bearer $TELEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_input": {"query": "when was the International Space Station launched"},
       "search": {"providers": {"include": ["exa", "brave"]}, "num_results": 5}}'
```

Two is a good default: `exa` (embedding-based, matches on meaning) plus `brave` (an
independent keyword index) covers both retrieval styles. Widen the list when recall
matters more than the bill. Keep `search.providers.include` explicit so the cost of a
call is a decision, not an accident.

The two operations are Search and Fetch. Search posts to `/v1/search`; page fetch posts
to `/v1/fetch` with a top-level `urls` array. Those two are the whole HTTP surface.
There is no third endpoint to look for, and no GET to read results back with, because a
search response already has them.

Read the response's per-provider runs. Each has its own normalized results and its own
error state, so one failed provider gives a partial result, not a failed request. Check for
failed providers before you tell the user that a query returned nothing.

## Deep integration: when the user wants more than the API

If the user wants search *and* page fetch as native tools in their coding agent, with
retrieval metrics and trajectory analytics in the console, point them at the one-line installer. It
detects the frameworks already installed on their machine and installs into as many as they
select in one pass:

```bash
curl -fsSL https://docs.telem.ai/install.sh | sh
```

Do not run this yourself without asking. It writes their framework config and their API
key (to `~/.telem/credentials.json`, and for Claude Code and Codex also into their own
config), and nothing else: not their shell rc, not their npm config. Flags pass straight
through to the installer: `--dry-run` prints the plan and changes nothing. With no
prompts, pass all three of `--yes --client opencode,codex --key-env TELEM_API_KEY`.
`--client` picks the agents only in a `--yes` run, and without `--key-env` no key is
saved. It is POSIX **sh**: `| sh` is correct, and is what it is tested under.

## Migration play: code that already calls a search provider

When you find a direct call to a search provider in the user's codebase:

1. **Ask first.** Name what changes: one key instead of several, one response shape,
   multiple indexes instead of one. Name what it costs: a new dependency and a new bill. Do not
   start editing.
2. **Find every call site** before changing any of them. A partial migration leaves two
   keys and two response shapes, which is worse than either alone.
3. **Replace the request.** Provider-specific parameters do not move over. The portable
   controls are `tier` (`minimalist` | `default` | `extended` | `max`), `fields`,
   `num_results`, and the provider include/exclude pair. A provider-native parameter with
   no portable equivalent goes in `provider_overrides`, keyed by provider slug. It works only
   when an explicit provider include names that provider.
4. **Replace the parsing.** This is the part that gets smaller: one normalized shape
   replaces the per-provider adapter. Keep the provider attribution: the user will want to
   know which index found what.
5. **Keep the old key working until the new path is proven** against real queries, then
   remove it in a separate change.
6. **Do not blend the two.** Half the queries on the old provider and half on Telem makes
   both bills and neither set of results explainable.

If the codebase is calling the *host's own* built-in web search tool rather than a provider
API, the migration is different: install the plugin for that host (the one-liner above) and
let it route the built-in tool through Telem. Do not rewrite tool call sites by hand.

## Choosing an integration

| The user is... | Install |
|---|---|
| Running any agent framework, wants the fastest path | `curl -fsSL https://docs.telem.ai/install.sh \| sh` |
| Using a host with agent-skill support | `npx skills add https://docs.telem.ai` |
| Using OpenClaw | The OpenClaw plugin |
| Using OpenCode | The OpenCode plugin |
| Using Pi | The Pi package |
| Using Claude Code | The Claude Code plugin: the one-liner above (`--client claude-code`) |
| Using Codex | The Codex install: the one-liner above (`--client codex`) |
| Using any other MCP client | The hosted MCP server (`https://mcp.telem.ai/mcp`) |
| Writing Python | The SDK (`telem-sdk`) |
| Writing anything else | Direct HTTP |

## Before you finish: checklist

- [ ] `TELEM_API_KEY` is read from the environment. It is not in source, not in a commit,
      not in a client bundle, and not in any command line you printed.
- [ ] Requests go out from a server, never from a browser.
- [ ] The user agreed to the integration, and to replacing anything that already worked.
- [ ] Per-provider failures are handled: a failed provider is reported, not silently read
      as "no results".
- [ ] Search goes to `POST /v1/search`; page reads go to `POST /v1/fetch`. You did not
      invent a third endpoint, and you did not add a GET to read results back. A search
      response already has them.
- [ ] If a Telem plugin is installed in this host, you called `telem_search` / `telem_fetch`
      rather than writing your own HTTP client alongside it.
- [ ] Options the user set are in `.telem/telem.json`, not scattered per call. See the
      config reference.
- [ ] You told the user what a search costs them, if you set up anything that runs on a
      schedule or in a loop.

---

# Verified install commands

Everything below is copied from the install-verification suite (`docs-verify/`) and is run
unmodified by it. Generated: do not hand-edit.

## OpenClaw

```bash
openclaw plugins install npm:@telemai/openclaw-plugin
# Adds your key to the Gateway's .env once, and only if TELEM_API_KEY is set
[ -n "$TELEM_API_KEY" ] && ! grep -qs '^TELEM_API_KEY=' ~/.openclaw/.env && echo "TELEM_API_KEY=${TELEM_API_KEY}" >> ~/.openclaw/.env
openclaw gateway restart
```

- Requires OpenClaw >= 2026.7.1.
- Gateway restart required after install.

## OpenCode

```bash
opencode plugin @telemai/opencode-plugin --global
export TELEM_API_KEY=...   # your key
```

- One command writes `opencode.jsonc` and materializes the package.

## Pi

```bash
pi install npm:@telemai/pi-telem
export TELEM_API_KEY=...   # your key
```

- The `npm:` prefix is required.

## DeepSeek Harness

```bash
dsh plugin --profile web add @telemai/dsh-plugin
export TELEM_API_KEY=...   # your key (or run `npm create @telemai`)
```

- Experimental, and installed per profile: repeat the command for each profile you use.
- `pnpm` must be on the `PATH`; `dsh plugin` installs into a profile through it.
- The tools are registered globally, so every agent preset sees them.

## MCP (hosted)

```bash
claude mcp add --transport http telem https://mcp.telem.ai/mcp --header "Authorization: Bearer your-telem-api-key" --header "X-Telem-Auto-Routing: accuracy"
```

- The hosted server is `https://mcp.telem.ai/mcp` (Streamable HTTP). It runs on Telem's side, so you install and run nothing.
- Any other MCP client: put that URL and an `Authorization: Bearer $TELEM_API_KEY` header in its remote-MCP config.
- It runs the deployment defaults. By design, its tool schemas have no tier or provider options.

## Python SDK

```bash
pip install telem-sdk
```

```python
from telem import Telem

client = Telem()  # reads TELEM_API_KEY / TELEM_BASE_URL from env
response = client.search("when was the International Space Station launched")
print(response.results[0].title)
```

- `TELEM_API_KEY` (and optional `TELEM_BASE_URL`) are read from the environment.

## JavaScript SDK

```bash
npm install @telemai/sdk
```

```js
import Telem from "@telemai/sdk"

const telem = new Telem() // reads TELEM_API_KEY / TELEM_BASE_URL from env
const response = await telem.search("when was the International Space Station launched")
console.log(response.results[0].title)
```

- `TELEM_API_KEY` (and optional `TELEM_BASE_URL`) are read from the environment. On Node 20.16+ the SDK also reads `~/.telem/credentials.json`, the file the guided installer writes.
- Zero runtime dependencies; ESM and CommonJS; any runtime with `fetch`.

## HTTP

```bash
# Every request needs a key: without one, the router answers
# 401 {"detail": "Missing API key"}.
auth_header=()
if [ -n "${TELEM_API_KEY:-}" ]; then
  auth_header=(-H "Authorization: Bearer $TELEM_API_KEY")
fi

curl -s -X POST "$TELEM_BASE_URL/v1/search" \
  "${auth_header[@]}" \
  -H "Content-Type: application/json" \
  -d '{"user_input": {"query": "when was the International Space Station launched"},
       "search": {"providers": {"include": ["exa", "brave"]}, "num_results": 5}}'
```

- Search: `POST /v1/search`. Page fetch: `POST /v1/fetch`.
- Every request needs `TELEM_API_KEY`; without it the router answers `401 Missing API key`.

## Hermes

```bash
hermes plugins install TelemAI/hermes-plugin
hermes plugins enable telem
```

- Hermes installs `telem-sdk` into its own environment when the plugin is enabled; no `pip` step.
- Hermes needs Python 3.14; the Hermes installer sets it up.
- Needs Hermes 0.21.6 or newer, from the official Hermes installer. Homebrew builds of Hermes cannot install the plugin (NousResearch/hermes-agent#126711).
- `hermes plugins list` confirms discovery. `hermes plugins` on its own opens an interactive menu.
- Tools sit behind Hermes's `tool_search` catalog by default rather than in the model's initial tool list.
