pi-sub2api-gateway
v0.1.0
Published
Connect pi to Sub2API — self-hosted AI router gateway with your own endpoint and API key
Downloads
23
Maintainers
Readme
Install
pi install npm:pi-sub2api-gatewayOr from git:
pi install git:github.com/billyriantono/pi-sub2apiWhat you get
| Command | Role |
|---------|------|
| /sub2api | Connect · set endpoint + your API key · sync models · diagnose · browse |
| /sub2api-refresh | Headless re-sync of the model list |
Provider sub2api is registered with pi's model picker (/model) using the
OpenAI-compatible GET /v1/models catalog, enriched with curated display names,
reasoning/vision flags, and context limits.
60-second start
1. /sub2api # open the menu
2. Connection → Endpoint # your Sub2API base URL, e.g. https://sub2api.example.com/v1
3. Connection → API key # paste your key (Sub2API dashboard → API Keys)
4. Test connection # expect "OK · N models · XXms"
5. Sync models # register chat models
6. /model # provider sub2apiNo key? Use the SUB2API_KEY environment variable instead:
export SUB2API_KEY=sk-xxxx # then /sub2api → Sync models
export SUB2API_URL=http://127.0.0.1:8080/v1 # optional, this is the defaultDocs
| Doc | | |-----|--| | Setup | Install, first run, env vars | | Usage | Menus, sync, key management | | Dev | Layout for contributors, tests |
Links
- Sub2API · pi.dev · Package gallery
- Modeled on pi-apikodex / @qmahyar/pi-9router
License
MIT
