---
slug: "pi-service-tier"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/mavam/pi-service-tier@main/README.md"
repo: "https://github.com/mavam/pi-service-tier"
source_file: "README.md"
branch: "main"
---
# ⚡ pi-service-tier

A [pi](https://github.com/earendil-works/pi-mono/tree/main/packages/coding-agent)
extension that toggles fast mode and applies provider service tiers.

## 🚀 Installation

```sh
pi install npm:pi-service-tier
```

## ✨ What it does

- Adds service tier parameters to supported provider requests when a tier is
  configured
- Adds `/fast` to toggle the current model provider between fast mode and off
- Adds `/service-tier` to configure all supported providers from an interactive
  modal
- Adds an optional service tier widget when `pi-fancy-footer` is installed

## 🚀 Commands

- `/fast`: toggles the current model provider between its fast tier and off. The
  supported providers all use `priority` as the fast tier.

- `/service-tier`: opens an interactive editor. The current model provider
  appears first, followed by the remaining supported providers. Press Enter or
  Space to cycle through `off` and the provider-specific tiers.

## ⚙️ Configuration

Run `/service-tier` or create `~/.pi/agent/service-tier.json`:

```json
{
  "openai": "priority",
  "openai-codex": "flex",
  "anthropic": "priority",
  "google": "priority",
  "google-vertex": "flex"
}
```

### Supported providers

| Provider        | Tiers                  | Fast tier  |
| --------------- | ---------------------- | ---------- |
| `openai`        | `flex`, `priority`     | `priority` |
| `openai-codex`  | `flex`, `priority`     | `priority` |
| `anthropic`     | `priority`, `standard` | `priority` |
| `google`        | `flex`, `priority`     | `priority` |
| `google-vertex` | `flex`, `priority`     | `priority` |

To turn a provider off, omit its key. Only the values listed above are accepted.
Batch APIs are separate asynchronous APIs and are not configured by this
extension.

## 🧩 Footer widget

When [pi-fancy-footer](https://github.com/mavam/pi-fancy-footer) is installed,
the widget appears only when the active model uses a supported provider/API pair
and that provider has a configured tier. It shows a single `⚡` without the tier
name to keep the footer compact.

The widget id is `pi-service-tier.service-tier`. It uses the current
`pi-fancy-footer` event protocol, with row `1`, position `8`, right alignment,
and no fill behavior by default. The extension has no package dependency on the
footer: it publishes a complete snapshot when its state changes and republishes
when the footer announces that it is ready.

## 📝 TODO

- Account for service-tier pricing in pi usage metrics. The extension currently
  injects the tier into the provider request payload, but pi's OpenAI Codex cost
  calculation reads the requested tier from provider options. Until pi exposes a
  first-class extension path for that option, displayed usage costs can omit
  flex or priority multipliers.

## 🧹 Uninstall

```sh
pi remove npm:pi-service-tier
```

## 📄 License

[MIT](https://github.com/mavam/pi-service-tier/tree/HEAD/LICENSE)
