← Catalog

pi-sub2api-gateway

Connect pi to Sub2API — self-hosted AI router gateway with your own endpoint and API key

Extension

Install

Install with PiG

pig install npm:pi-sub2api-gateway

Install with Pi

pi install npm:pi-sub2api-gateway
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions/sub2api.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

Sub2API  ×  pi

pi-sub2api-gateway

Connect pi to your own Sub2API gateway — with your own endpoint and API key.
Sync chat models from a Sub2API instance (self-hosted, OpenAI-compatible) into pi as provider sub2api.

npm pi-package license


Install

pi install npm:pi-sub2api-gateway

Or from git:

pi install git:github.com/billyriantono/pi-sub2api

What you get

CommandRole
/sub2apiConnect · set endpoint + your API key · sync models · diagnose · browse
/sub2api-refreshHeadless 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 sub2api

No 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 default

Docs

Doc(blank)
SetupInstall, first run, env vars
UsageMenus, sync, key management
DevLayout for contributors, tests

License

MIT