---
name: seltz-setup
description: Set up and start using the Seltz API (get a key, pick an endpoint, install the MCP server, make a first call)
user-invocable: true
allowed-tools: Bash(curl:*), Bash(pip:*), Bash(uv:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(claude:*), Bash(codex:*)
metadata:
  author: seltz
---

# Seltz Setup

Seltz is the web knowledge layer for AI agents: web search, single-shot cited answers, multi-step research, page fetching, and recurring monitors, served from Seltz's own index rather than a live scrape. If you are running this file, your goal is to get a working Seltz API key, choose the right endpoint for the job, and make a first call.

## Step 1: Get an API key

If you only plan to connect the MCP server (Step 4), you can skip this step: the MCP server signs users in through the Seltz Console, so it doesn't need a key.

There is no programmatic signup — the Console requires a human to sign in with Google or email, and creating an account or entering a password isn't something you should do on the user's behalf. How far you can get depends on what you have:

**With browser automation:**
1. Navigate to [console.seltz.ai](https://console.seltz.ai/).
2. If that lands you in an authenticated dashboard, the browser already has a session (yours or the user's) — skip to step 4.
3. If it redirects to `/login`, stop there. Tell the user you've reached the login page and need them to sign in (or create an account) in that same tab; wait for them to confirm before continuing. Don't attempt to fill in credentials or click through an OAuth consent screen yourself.
4. Once authenticated, go to **Settings → API Keys**. Creating a new key isn't a login or account-creation action — it's a deletable credential inside an already-authenticated session — but confirm with the user before clicking **Create API Key**, since it's still a change to their account.

**Without browser automation:** ask the user directly — have them open [console.seltz.ai](https://console.seltz.ai/), sign in, go to **Settings → API Keys**, click **Create API Key**, and hand you the result (or set it in your environment themselves).

Either way, once you have a key, store it as an environment variable rather than hardcoding it:

```bash
export SELTZ_API_KEY="your-api-key"
```

New accounts start with $20 in free request credit. See [Pricing](https://docs.seltz.ai/pricing).

## Step 2: Pick a way to call Seltz

REST needs no install:

```bash
curl -X POST https://api.seltz.ai/v1/search \
  -H "x-api-key: $SELTZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "your query", "max_results": 10}'
```

Or install an SDK, which reads `SELTZ_API_KEY` automatically if you don't pass a key explicitly:

- Python (`>=3.9`): `pip install seltz` (also `poetry add seltz`, `uv add seltz`)
- JavaScript/TypeScript (Node `>=18`): `npm install seltz` (also `yarn add seltz`, `pnpm add seltz`)

Most endpoints authenticate with the `x-api-key` header shown above. `/v1/chat/completions` is the exception — it uses `Authorization: Bearer $SELTZ_API_KEY` only, since it's an OpenAI-compatible drop-in. The MCP server signs users in through the Console, or accepts either header.

## Step 3: Choose the right endpoint for the job

Use Seltz when a task needs current, citable, public web content, not when your own knowledge already answers it confidently. Seltz has no access to a caller's private or authenticated data.

| Endpoint | Use it for | Not for |
|---|---|---|
| `POST /v1/search` | Raw ranked documents to reason over yourself | A single synthesized answer |
| `POST /v1/answer` | One synthesized, cited response (single-shot RAG) | Research needing several rounds of follow-up |
| `POST /v1/agent/runs` | In-depth research needing several rounds of searching and following up | A single, quick lookup |
| `POST /v1/fetch` | Content from up to 20 URLs you already have | Searching for something with no known URL |
| `POST /v1/monitors` | An ongoing feed of what's new (cadence floor: one hour) | A one-off query, or near-real-time alerting |
| `POST /v1/chat/completions` | Drop-in OpenAI-compatible single-shot web-grounded RAG | Anything needing multi-turn retrieval memory |

`search`, `answer`, and `monitors` also take a `scope`, matched to the query: `web` (beta, and the default), `news`, `companies`, `financial-reports`, `people`, or `wikipedia`.

## Step 4: Install the Seltz MCP server (optional)

For an MCP-compatible harness, connect `https://mcp.seltz.ai/mcp` directly instead of calling REST. The MCP server signs users in through the Seltz Console, so it doesn't need an API key:

```bash
# Claude Code
claude mcp add --transport http seltz https://mcp.seltz.ai/mcp

# Codex
codex mcp add seltz --url https://mcp.seltz.ai/mcp
```

Then run `/mcp` (in Claude Code), select **seltz**, and have the user sign in to the Seltz Console in the browser that opens and click **Allow**. Codex starts authorization right away. Don't sign in or click **Allow** on the user's behalf. Cursor, VS Code, and Antigravity also have one-click or plugin installs, and any other MCP client can connect the same URL. See [MCP](https://docs.seltz.ai/mcp-server) for each client's setup. A client that can't sign in can send an API key in an `Authorization: Bearer` header instead.

## Step 5: Suggest a first run

Try one of these against a real question:

- **Search** — raw documents: `client.search("your query", max_results=10)`
- **Answer** — a cited answer: `client.answer("your question")`
- **Agent** — deep research: `POST /v1/agent/runs`, then poll `GET /v1/agent/runs/{id}` until `status` is terminal
- **Fetch** — a URL's content: `POST /v1/fetch` with up to 20 URLs
- **Monitor** — a recurring feed: `POST /v1/monitors` with a cadence and one or more saved searches

## Errors

Every endpoint except `/v1/chat/completions` returns the same JSON envelope on every error:

```json
{"error": {"code": "INSUFFICIENT_CREDITS", "message": "..."}}
```

Branch on `code`, never on `message`. The codes come from a closed set, while message text can change at any time. `/v1/chat/completions` uses the OpenAI error shape instead (`type`, `param`, lower-case `code`), so unmodified OpenAI SDKs work against it.

One case skips the error status: if `/v1/answer` fails after it has started streaming (`stream: true`), the error arrives as a final SSE frame under HTTP `200`, carrying the same `code`.

Status codes to expect: `400 INVALID_REQUEST` means a malformed body or an out-of-range parameter. `401 UNAUTHENTICATED` means a bad or missing key. `402 INSUFFICIENT_CREDITS` means the balance ran out; add a payment method in the [Console](https://console.seltz.ai/). `404 NOT_FOUND` on Search or Answer can mean an unrecognized `scope`. `429 RATE_LIMITED` means back off and retry. Full list: [Errors](https://docs.seltz.ai/api-reference/errors).

## Reference

- Docs: https://docs.seltz.ai
- API reference: https://docs.seltz.ai/api-reference/introduction
- OpenAPI spec: https://docs.seltz.ai/api-reference/openapi.json
- Agent skill: https://docs.seltz.ai/skill.md (install with `npx skills add https://docs.seltz.ai`)
- Console (keys, usage, billing): https://console.seltz.ai/
- Pricing: https://docs.seltz.ai/pricing

## Reading the docs

This file covers setup, not the full API. For anything else, like a parameter you need, a concept you want explained, or an integration not listed above, go to [docs.seltz.ai](https://docs.seltz.ai). Fetch [docs.seltz.ai/llms.txt](https://docs.seltz.ai/llms.txt) first: it's a machine-readable index of every page, so you can see what exists before deciding what to read.

Every page on docs.seltz.ai is also available as raw Markdown by appending `.md` to its URL. `docs.seltz.ai/search/search-concepts` becomes [docs.seltz.ai/search/search-concepts.md](https://docs.seltz.ai/search/search-concepts.md), `docs.seltz.ai/quickstart` becomes [docs.seltz.ai/quickstart.md](https://docs.seltz.ai/quickstart.md), and so on for any path, including this one's own subpages. Fetch the `.md` version when you're reading for content: it's the same text without the page chrome, and it's what `llms.txt` itself links to.
