# Run a model evaluation

Pick a benchmark and a model, check the quote, and start the run from your terminal.

The flow has five steps:

- Choose a benchmark and a model.
- Review the quote and set a spending cap.
- Accept the quote. EvalRouter sets a little credit aside for each running task and charges actual usage.
- Wait while the tasks run and EvalRouter grades them.
- Read the results and exports.

A model provider you connect may bill inference separately.

## Install and sign in

1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then the CLI:

   ```sh
   uv tool install evalrouter
   ```

   If your shell can't find the command, run `uv tool update-shell` and restart the terminal. Upgrade later with `evalrouter upgrade`.

2. Sign in through your browser. The CLI picks a workspace after sign-in.

   ```sh
   evalrouter login
   evalrouter whoami
   ```

   For remote terminals and CI, see [CLI sign-in](/developers/docs/cli-login).

## Run in one step

```sh title="CLI"
evalrouter run gpqa-diamond --model gpt-4o-mini --sample 25
```

```python title="Python"
from evalrouter import EvalRouter

client = EvalRouter()  # reads EVALROUTER_API_KEY
run = client.runs.create(benchmark="gpqa-diamond", model="gpt-4o-mini", wait=True)
print(run.score)
```

```typescript title="TypeScript"
import { EvalRouter } from "@kimpton-ai/evalrouter";

const client = new EvalRouter(); // reads EVALROUTER_API_KEY
const run = await client.runs.create({ benchmark: "gpqa-diamond", model: "gpt-4o-mini", wait: true });
console.log(await run.score());
```

The CLI quotes the run, shows the quote, asks you to confirm, then follows it to the results. Add `--max-cost USD` to set a spending cap: new work stops when it can't fund the next call, and calls already running finish and are charged.

> [!WARNING]
> In a script, pass `--yes`. Without it, the CLI creates no quote, charges nothing and exits with status 5.

## Quote, then start

1. Find benchmark profile and model IDs:

   ```sh
   evalrouter benchmarks list --json
   evalrouter models list --json
   ```

2. Save a quote request as `quote.json` with your IDs. To cap the run, add `max_charge_microusd` in micro-USD (2,000,000 is $2): new work stops when the cap can't fund the next call. Without it, your wallet balance limits the run.

   ```json
   {
     "model": {"kind": "managed", "route_id": "MODEL_ROUTE_ID"},
     "selection": {"profile_ids": ["BENCHMARK_PROFILE_ID"]},
     "coverage": {"mode": "sample", "sample_count": 3, "seed": 42}
   }
   ```

3. Review the quote, start it and read the result:

   ```sh
   evalrouter quotes create --body quote.json --json
   evalrouter runs create --quote QUOTE_ID --yes --wait --json
   evalrouter runs results RUN_ID
   evalrouter runs export RUN_ID --file-format html,json
   ```

A quote checks compatibility, coverage and prices without calling a model. Starting the same quote again returns the same run, so a retry never starts a second one. [CLI commands](/developers/docs/cli) lists every command and exit status.

## Use HTTP

Create a [workspace API key](/developers/docs/authentication) with the `eval:read` and `eval:write` scopes, then:

1. Send the same body to the quotes endpoint.

2. Start the quote with `POST /v1/runs`, restating its cap.

3. Follow the run with `GET /v1/runs/{run_id}`, then read its results.

The [API schema](/developers/docs/openapi.json) lists every field.
