pi-flex-processing
Pi extension to switch OpenAI API requests between normal and Flex processing from chat UI.
Package details
Install pi-flex-processing from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-flex-processing- Package
pi-flex-processing- Version
0.1.2- Published
- May 29, 2026
- Downloads
- not available
- Author
- laxman777
- License
- MIT
- Types
- extension
- Size
- 9.9 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/openai-flex.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-flex-processing
A tiny pi extension that lets you switch OpenAI API requests between normal processing and Flex processing from the chat UI.
Flex processing lowers cost for supported OpenAI models in exchange for slower responses and occasional resource unavailability.
Install
pi install npm:pi-flex-processing
Usage
Inside pi:
/flex
Opens a simple selector for normal vs flex processing.
Direct commands:
/flex on # enable OpenAI flex processing where supported
/flex off # use normal OpenAI processing
/flex toggle # switch between modes
/flex status # show current mode
Alias:
/openai-flex
Supported OpenAI Flex models
As of 2026-05-29, OpenAI's Flex pricing table lists:
gpt-5.5gpt-5.5-progpt-5.4gpt-5.4-minigpt-5.4-nanogpt-5.4-pro
When flex mode is enabled on an unsupported OpenAI model, the extension warns once and sends normal processing instead (service_tier: "default"). The footer shows openai:flex n/a.
Behavior
- Applies only to pi's
openaiprovider, i.e. the provider that usesOPENAI_API_KEY. - Supported model + flex mode: sends
service_tier: "flex". - Unsupported model + flex mode: warns and sends
service_tier: "default". - Normal mode: sends
service_tier: "default". - The selected mode is persisted in the current pi session.
Publishing
This repo publishes to npm through GitHub Actions and npm Trusted Publishing when a version tag is pushed.
One-time setup: configure npm Trusted Publishing for this package with GitHub Actions, repository laxman-patel/pi-flex-processing, workflow filename publish.yml, and no environment name.
Release flow:
npm version patch
npm pack --dry-run
git push --follow-tags
The pushed vX.Y.Z tag triggers .github/workflows/publish.yml, verifies the tag matches package.json, and runs npm publish --access public via OIDC trusted publishing.
Package metadata
This repo is structured as a pi package:
{
"keywords": ["pi-package"],
"pi": {
"extensions": ["./extensions/openai-flex.ts"]
}
}
That makes it discoverable by the pi package gallery at https://pi.dev/packages once published/listed.
Security note
Pi extensions run with your full system permissions. Review any extension before installing it.