> ## Documentation Index
> Fetch the complete documentation index at: https://docs.while.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Install with `uv add whileai`; import as `import whileai as wai`.
> Run the offline path first (`simulator=False`, `wai.seeded_agent`, a callable judge); no key is needed for it.
> Report every pass rate with its interval and n, as `scored.pass_at` prints it.

# Install

> Install whileai and check it works.

**What you learn:** install the package, set the two kinds of key, and set up a repo for a coding agent. **Needs:** Python 3.10 to 3.13. **Takes:** a minute.

```bash theme={"theme":"vitesse-dark"}
uv add whileai
```

```python theme={"theme":"vitesse-dark"}
import whileai
print(whileai.__version__)   # 0.88
```

Python 3.10 to 3.13.

## Set up a repo for your coding agent

```bash theme={"theme":"vitesse-dark"}
wai init
```

One command in the repository your agent works in. It writes a short block
into `AGENTS.md` (Codex, Cursor and Copilot read it), points `CLAUDE.md` at
it (Claude Code reads that), installs the tested skills under
`.claude/skills/`, and runs the evals skill's `check.py` so the agent sees
the verdict line before it touches your code. After that, "use whileai to
build me better evals for my agent" lands on the playbook with no URL to
remember. Run it again after an upgrade; `wai status` says when the
block is stale.

## Extras

| Install                   | When                                                           |
| ------------------------- | -------------------------------------------------------------- |
| `uv add 'whileai[rl]'`    | You export an RL environment for a GRPO trainer. Python 3.11+. |
| `uv add trl transformers` | You train with your own TRL. Any version.                      |

## Keys

Bring your own keys. Your model keys never leave your machine.

The [quickstart](/get-started/quickstart) needs no key at all.

A While key adds hosting: we store your datasets, run the hosted judge, train and serve.

```bash theme={"theme":"vitesse-dark"}
wai login      # opens the browser, saves a key on this machine
```

```python theme={"theme":"vitesse-dark"}
import whileai as wai

wai.configure(
    api_key="zp_...",                                    # While key
    agent=wai.OpenAI("gpt-4.1-mini", api_key="sk-..."),  # your model, your key
)
print(wai.settings)                                      # which model and key each role uses
```

Both keys can come from env vars instead: `WHILEAI_API_KEY`, `OPENAI_API_KEY`.
`wai login` saves the While key at `~/.whileai/credentials.json`;
`WHILEAI_HOME=/some/fresh/dir` isolates a second account, and
`wai status` prints which key the SDK will use.

**The trial.** `wai signup --email you@example.com` makes an account
with no browser. A fresh key gets 25,000 input and 50,000 output tokens a
day, about twelve hosted situations of a four-tool agent; a run past that
stops with `Hosted model daily quota exceeded`. `simulate(...,
simulator=False)` writes situations offline with no quota, and one sign-in
at the While site (the link `wai status` prints) lifts the limit.
Other backends: [connect your agent](/get-started/connect-your-agent).
