A Pi Coding Agent extension that registers Requesty as an OpenAI-compatible model provider.
The model catalog is discovered from the Requesty /models endpoint and cached through Pi's standard provider model store, so it refreshes automatically on startup and when the model picker opens. No manual models.json edits are required.
pi install git:github.com/requestyai/pi-requestyTo run once without installing:
pi -e ./pi-requestypi install ./pi-requestySet your Requesty API key via either of these two methods:
Option 1 — /login (recommended): inside Pi, run
/login requesty
and paste your API key.
Option 2 — environment variable:
export REQUESTY_API_KEY="rqsty-sk-..."The endpoint and model list are handled automatically — there is no need to add a requesty provider block to ~/.pi/agent/models.json. Models are discovered and cached at runtime.
The extension registers the provider with an empty baseline catalog and a
refreshModels hook. Pi invokes that hook:
- on startup (first offline, restoring the cached catalog, then online),
- whenever the model picker or a model refresh runs.
Discovered models are written to Pi's provider model store and reused on the next launch, so the catalog is available even when offline or before the first network refresh completes. This is the same mechanism Pi uses for its built-in dynamic providers.
- API:
openai-completions(Requesty is OpenAI-compatible). - Endpoint:
https://router.requesty.ai/v1(/modelsfor discovery,/chat/completionsfor streaming).
Unit tests use Node's built-in test runner (no external dependencies):
npm testCoverage includes price/context mapping, /models discovery (HTTP + parsing), the
refreshModels caching/auth-gating behavior, and registerProvider config.
- v0.3.0 (breaking):
- Replaced hand-rolled
models.jsonreading/writing with Pi's standardrefreshModels+ provider model store caching. - Removed the
/requesty-models-synccommand; models now refresh automatically (startup + model picker). - Authentication is now configured via
/login requestyorREQUESTY_API_KEYenvironment variable; arequestyblock inmodels.jsonis no longer used.
- Replaced hand-rolled
- v0.2.x: earlier versions read/wrote
providers.requesty.modelsdirectly in~/.pi/agent/models.jsonand exposed/requesty-models-sync.