> Keiro Labs API documentation - Pi Setup
> Page: https://docs.keirolabs.ai/pi.html
> Markdown: https://docs.keirolabs.ai/pi.md
> Agent index: https://docs.keirolabs.ai/llms.txt
> API base URL: https://api.keirolabs.ai/v1
> Auth: send "Authorization: Bearer <api-key>" with a key created in the
> Keiro console (https://console.keirolabs.ai/api-keys). Use credentials saved by
> `keiro setup`, or resolve the key from a secret manager or an owner-only
> secret file and pass it to the client explicitly. Never read another
> provider's variable, and never put raw key material in environment
> variables, code, docs, or logs.

# Use eb1 with Pi

Pi is an efficiency-first, customizable coding-agent harness. Use Keiro through
Pi's custom model configuration when lower context overhead, local control, and
a minimal terminal workflow matter.

## Before you configure

1. Open [API keys](https://console.keirolabs.ai/api-keys).
2. Create a dedicated key for this Pi installation.
3. Keep the newly revealed secret available in your password manager until
   setup is complete.

A dedicated key lets you inspect and revoke Pi traffic independently from
production application traffic.

## Install and configure

Install Pi with the `@earendil-works/pi-coding-agent` package, or run it through
`npx`:

```bash
npm install --global --ignore-scripts @earendil-works/pi-coding-agent@latest
# or
npx --yes @earendil-works/pi-coding-agent@latest --help
```

Pi reads custom model definitions from `~/.pi/agent/models.json`. Add a Keiro
provider entry that uses the OpenAI-compatible completions API:

```json
{
  "providers": {
    "keiro": {
      "baseUrl": "https://api.keirolabs.ai/v1",
      "api": "openai-completions",
      "apiKey": "keiro_sk_...",
      "compat": {
        "supportsStore": false,
        "supportsDeveloperRole": false,
        "supportsReasoningEffort": false
      },
      "models": [
        { "id": "eb1-preview", "contextWindow": 400000, "maxTokens": 32000 },
        { "id": "eb1-frontier-preview", "contextWindow": 400000, "maxTokens": 32000 },
        { "id": "eb1-fast-preview", "contextWindow": 240000, "maxTokens": 32000 },
        { "id": "eb1-efficient-preview", "contextWindow": 400000, "maxTokens": 32000 }
      ]
    }
  }
}
```

Replace `keiro_sk_...` with the key secret you created, then select the model as
`keiro/eb1-preview` or pass it on the command line:

```bash
pi --provider keiro --model eb1-preview
```

`contextWindow` mirrors each model's published `context_window` in
[`/v1/models`](api-reference.md). `maxTokens` is the generation cap Pi requests
per turn; adjust it to match your plan's output-token budget.

Keep `~/.pi/agent/models.json` owner-readable because it contains the key. Do
not place raw secret bytes in shared project files.

## Models

Start with `eb1-preview`. Switch models when the task has a clear quality,
latency, or cost requirement:

- `eb1-preview`
- `eb1-frontier-preview`
- `eb1-fast-preview`
- `eb1-efficient-preview`

See [Models](models.md) for what each model is for.

## Efficiency positioning

External benchmark evidence makes Pi a strong efficiency-oriented
harness choice, especially when context volume and cost are first-order
constraints. That does not make it the universal quality leader: outcome quality
still depends on the selected model, task type, repository shape, and tool
configuration.

## Authentication

The key is sent as `Authorization: Bearer`, the same credential form as every
other public endpoint. See [API auth](api-auth.md). A `401` means the configured
key is missing, invalid, or revoked.

Requests from Pi appear in Keiro Usage and Logs like other API traffic.

## Rotate the Pi key

1. Create a replacement dedicated key in the console.
2. Update the key in Pi's local configuration or secret store.
3. Verify a harmless request.
4. Delete the old key in the console.

## Related pages

- [API keys](api-keys.md)
- [API auth](api-auth.md)
- [Models](models.md)
- [Responses](responses.md)
- [Usage and billing](usage-billing.md)
- [Pi repository](https://github.com/earendil-works/pi)
