pi-fast-lane0.2.3
One /fast toggle for Pi: OpenAI priority service tier and Anthropic Claude fast mode (speed: fast).
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-fast-lane
One /fast toggle for Pi that turns on the provider's fast mode for both OpenAI and Anthropic Claude models.
- OpenAI models (
openai,openai-codex, …): addsservice_tier: "priority"to the request. - Anthropic models (
anthropic-messagesAPI): addsspeed: "fast"and appends thefast-mode-2026-02-01beta. Pi's existing betas (OAuth, interleaved thinking, …) are kept.
The extension checks the current model's API and picks the right request fields automatically.
Forked from studioarray/pi-openai-fast (MIT). The command, footer, config, and subagent handoff behavior come from upstream. This fork adds Anthropic support.
Install
pi install npm:pi-fast-lane
Pin a version with npm:pi-fast-lane@0.2.0. The git source (git:github.com/doccker/pi-fast-lane@vX.Y.Z) still works.
Do not install it alongside pi-openai-fast, because both register /fast and --fast. Remove that package first.
Use it
/fast # toggle Fast Mode for this session
pi --fast # start a run with Fast Mode requested
Fast Mode is only sent when both of these are true:
- You requested it with
/fastor--fast. - The current model's
provider/modelkey is insupportedModels.
If you switch to an unsupported model, your preference is kept but nothing is sent until you switch back to a supported model.
OpenAI notes
Facts from the Codex speed docs, Codex pricing, and the API Fast mode guide (checked 2026-10-10):
- Request field:
service_tier: "priority". The official Codex CLI sends the same value for its Fast mode, and the API acceptspriorityorfast. - Default models: GPT-6.1 Sol, GPT-6 Sol (Codex), GPT-6 Astra, GPT-6 Luna, and GPT-5.6 Sol. GPT-5.5 retires from Codex on 2026-10-14, so it is no longer in the default list.
- ChatGPT sign-in (
openai-codex): Fast mode uses included plan limits at 2.5x the Standard rate; purchased credits are billed at 2x. - API key (
openai): Fast mode is billed per token at a premium; see the API pricing page for current rates. This extension does not adjustopenaicosts. - Codex cost display: the Codex backend reports
service_tier: "default"even for Fast Mode requests (observed 2026-10-10: Fast Mode streamed about 1.45x faster ongpt-6.1-solbut still reporteddefault), so Pi prices those turns at the standard rate. This extension multiplies the recorded cost of Codex turns it sent with Fast Mode byopenai.codexFastCostMultiplier. If a response does reportpriority, Pi has already priced it and the cost is left as is.
Anthropic notes (read before turning it on)
Facts from the Anthropic fast mode docs and the Claude Code fast mode docs (checked 2026-10-09):
- Supported models: Claude Opus 5.5, Opus 5, and Opus 4.8. Opus 4.7 rejects fast requests, so it is not in the default list.
- Price: 2x the standard rate on every token class. Opus 5.5 is $8/$40 per MTok; Opus 5 and 4.8 are $10/$50.
- Subscription (OAuth) logins: fast mode is billed to usage credits only, never to your plan limits. Turn on usage credits in Claude settings first.
- Prompt cache: switching speed invalidates the cache. The first fast request in a long session re-bills the whole context at fast rates. Turn it on at the start of a session when you can;
/fastshows a reminder. - Speed: up to 2.5x higher output tokens per second. Time to first token is not improved.
- Availability: first-party Anthropic API only. Not available on Bedrock, Vertex, or Foundry. Third-party relays may not forward it.
- Rate limits: fast mode has its own rate limits. Pi's normal 429 retry handling applies.
Claude subscription (OAuth) logins
Works with Pi's built-in Claude subscription login (/login → Anthropic). Nothing extra is needed for the request: Pi already sends the Claude Code identity (user agent, x-app, the claude-code and oauth betas, and the Claude Code system line), and this extension only appends the fast-mode beta and speed: "fast".
- When you turn on
/faston a subscription login, Pi shows a reminder that fast requests are billed to usage credits. - If Anthropic rejects a fast request, you get a hint instead of only the raw error. On a subscription login the hint points to usage credits.
- If fast mode hits its own rate limit, you get a hint to run
/fastand continue at standard speed. Fast mode stays on. - Set
anthropic.fallbackOnRejecttotrueto turn Fast Mode off for the rest of the session after a rejection. The saved preference is not changed, so the next session tries fast again. - Other extensions that edit Anthropic requests (for example a Claude Code billing-attribution extension) can run alongside this one; Pi passes the request through each extension in turn and this extension only touches
speedandbetas.
Without usage credits, Anthropic answers a fast request with 429 rate_limit_error and the message Usage credits are required for fast mode. (observed 2026-10-10). This extension treats that as a rejection, not a rate limit, so with fallbackOnReject Pi's automatic retry goes out at standard speed. Other 4xx errors count as rejections only when they mention fast mode, speed, or usage credits; everything else is shown as usual.
Cost display
Pi prices Anthropic responses at the standard rate. This extension reads the usage.speed value that Anthropic returns. When the server reports "fast", it doubles that message's recorded cost, so the session cost matches your bill. If the server ran the request at standard speed, the cost stays at standard.
Works with subagents
Turn on /fast in the parent session, then launch subagents. Subagents started after that inherit the preference through PI_FAST_LANE_DESIRED=1, as long as they use a supported model and have this extension installed. Each fast subagent is billed at fast rates.
Configure it
- Global:
~/.pi/agent/extensions/pi-fast-lane.json - Project:
.pi/extensions/pi-fast-lane.json(overrides the global file)
{
"persistState": false,
"desiredActive": false,
"supportedModels": [
"openai/gpt-6.1-sol",
"openai/gpt-6-astra",
"openai/gpt-6-luna",
"openai/gpt-5.6-sol",
"openai-codex/gpt-6.1-sol",
"openai-codex/gpt-6-sol",
"openai-codex/gpt-6-astra",
"openai-codex/gpt-6-luna",
"openai-codex/gpt-5.6-sol",
"anthropic/claude-opus-5-5",
"anthropic/claude-opus-5",
"anthropic/claude-opus-4-8"
],
"footer": {
"mode": "replace"
},
"anthropic": {
"fallbackOnReject": false
},
"openai": {
"codexFastCostMultiplier": 2.5
}
}
persistState: remember/fastbetween Pi runs.desiredActive: the saved on/off preference, used whenpersistStateistrue.supportedModels: exactprovider/modelkeys that may use Fast Mode. Setting this replaces the default list, so include every model you want, OpenAI and Anthropic alike. A custom provider (for example an Anthropic-compatible relay) works only if the upstream honorsspeedand the beta.openai.codexFastCostMultiplier: cost multiplier for Codex (openai-codex) turns sent with Fast Mode (default2.5, the ChatGPT plan rate). Use2if you pay with purchased credits,1to turn the correction off. Must be a number of at least 1.anthropic.fallbackOnReject: turn Fast Mode off for the current session when Anthropic rejects a fast request (defaultfalse).footer.mode:replaceshowsfastnext to the model name (default),statusshows a plain status indicator, andoffhides the indicator.
Custom label color
{
"footer": {
"mode": "replace",
"darkFastColor": "#00ffaa",
"lightFastColor": "#0066cc"
}
}
Invalid or missing colors fall back to the theme-matched color.
Troubleshooting
I turned Fast Mode on but do not see fast. Check that the current model is in supportedModels and that footer.mode is not off.
Anthropic requests fail after turning it on. Check that the model supports fast mode (not Opus 4.7), that usage credits are enabled for subscription logins, and that you are not routed through Bedrock, Vertex, or a relay. Run /fast to go back to standard speed, or set anthropic.fallbackOnReject to do it automatically.
How do I know a Claude response really ran fast? The cost of that turn is doubled only when Anthropic reported usage.speed: "fast".
My subagent is not using Fast Mode. It must start after /fast is turned on. Ask it to print PI_FAST_LANE_DESIRED; 1 means the preference was inherited.
Development
npm install
npm run check # tsc + node --test
Credits
- Upstream: studioarray/pi-openai-fast
- Upstream's own reference: pi-better-openai