fortytwo-pi0.1.0
Fortytwo Engine provider for Pi coding agent
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
Fortytwo for Pi
Adds Fortytwo as a model provider to Pi. After install, Fortytwo models appear in /model next to the built-in providers, with streaming, tool calls, image input and reasoning.
Setup guide: Connect pi in the Fortytwo docs.
Requires Pi 1.4.0 or later.
Install
pi install npm:fortytwo-pi
To try it for one run without installing:
pi -e npm:fortytwo-pi
To remove it: pi remove npm:fortytwo-pi.
Add your API key
Create a key on the API keys page of the Fortytwo Platform, then use one of these:
In Pi, run
/login, choose Sign in with an API key, select Fortytwo and paste the key. Pi stores it in~/.pi/agent/auth.json.Or set an environment variable before you start Pi:
export FORTYTWO_API_KEY="your-api-key"
Fortytwo models appear in /model only after Pi has a key for the provider.
Select the model
Run /model, search for qwen3.8 and choose qwen/qwen3.8-27b [fortytwo]. Press Ctrl+S to make it the default. From the command line:
pi --provider fortytwo --model qwen/qwen3.8-27b
While a Fortytwo model is active, the status line shows "Powered by Fortytwo".
Models
| Model ID | Name | Context (tokens) | Max output (tokens) | Input | Input price (USD / 1M tokens) | Output price (USD / 1M tokens) | Cached input price (USD / 1M tokens) |
|---|---|---|---|---|---|---|---|
qwen/qwen3.8-27b |
Qwen3.8 27B | 262,144 | 235,929 | text, image | 0.425 | 2.55 | 0.085 |
Current models: Models. Current prices: Pricing.
Reasoning
Use /thinking to set the reasoning level and Ctrl+S to save it. We recommend medium.
| Pi level | Sent to the API as reasoning_effort |
|---|---|
| off | none: reasoning is turned off |
| minimal, low, medium, high, xhigh, max | the same value |
Reasoning tokens count against the output limit.
Use as the default provider
Add to ~/.pi/agent/settings.json:
{
"defaultProvider": "fortytwo",
"defaultModel": "qwen/qwen3.8-27b",
"defaultThinkingLevel": "medium"
}
Alternative: models.json without the package
Pi can also reach Fortytwo through ~/.pi/agent/models.json, without installing this package. The values are in the setup guide.
Environment variables
| Variable | Meaning |
|---|---|
FORTYTWO_API_KEY |
API key, sent as the Bearer token. Not needed if you added the key with /login |
FORTYTWO_BASE_URL |
Overrides https://api.fortytwo.network/v1. For testing only |
Troubleshooting
- Fortytwo is not in
/model. Pi has no key for the provider. Add one with/loginorFORTYTWO_API_KEY, then open/modelagain. - Other problems. See Common problems or ask on Discord.
Development
npm install
npm run check # typecheck and unit tests, no network
Live checks call the production API and need a key:
export FORTYTWO_API_KEY="your-api-key"
npm run test:live # streaming, long context, reasoning, image input
npm run test:agent # installs the package into a temporary Pi: multi-step tool task with reasoning off and medium, and a session that triggers context compaction