@pi-lab/openai
Image generation, ChatGPT Fast controls and native web search for pi
Package details
Install @pi-lab/openai from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@pi-lab/openai- Package
@pi-lab/openai- Version
1.0.0- Published
- Nov 6, 2026
- Downloads
- 575/mo · 68/wk
- Author
- cheny341
- License
- MIT
- Types
- extension
- Size
- 52.1 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@pi-lab/openai
Image generation and editing through Codex or the OpenAI API, plus Fast mode and native web search for Pi.
Install and configure
pi install npm:@pi-lab/openai
Add the following to ~/.pi/agent/settings.json (global) or .pi/settings.json (project), preserving existing settings, then run /reload:
{
"openai": {
"fast": false,
"webSearch": true,
"imageGeneration": { "backend": "codex" }
}
}
All features are disabled by default. Project settings override global values; only trusted projects can override image configuration, which is replaced as a whole.
Features
Image generation
Adds the generate_image tool for image generation and editing with OpenAI models, including the GPT Image 2, 2.5 and 2.6 families.
Two backends are available: Codex and the OpenAI API. The Codex backend only supports gpt-image-2.
Configuration
Choose one of the following configurations:
{
"openai": {
"imageGeneration": { "backend": "codex" }
}
}
{
"openai": {
"imageGeneration": { "backend": "openai", "model": "gpt-image-2" }
}
}
Set imageGeneration to false to disable images. Disable @pi-lab/codex-image before enabling this feature, since both register generate_image.
Credentials
- Codex:
/login→ OpenAI Codex (legacy). Uses account quota. - OpenAI API:
OPENAI_API_KEY, or an OpenAI API key configured in Pi. The environment key takes precedence. Uses the official API endpoint and API billing.
Fast mode
Request Fast processing for chat. /fast toggles it; /fast on, /fast off and /fast status are also available. Command changes persist in the session; new sessions use settings.
Configuration
{
"openai": {
"fast": true
}
}
Credentials
OpenAI → Sign in with ChatGPT, with an openai chat model. Inactive when using openai-codex or API keys.
Web search
Enables native web search when using an openai chat model.
When @pi-lab/websearch is also installed, native search takes precedence on supported connections; other connections use @pi-lab/websearch.
Configuration
{
"openai": {
"webSearch": true
}
}
Credentials
OpenAI → Sign in with ChatGPT, with an openai chat model. Inactive when using openai-codex or API keys.