Files
AlexKucera 690fcdfe22 feat: Nous Portal provider with subscription OAuth and catalog filters
Registers the native nous-portal provider for pi. Nous retired
agent-key minting (410 session_key_minting_retired), which is where
both existing community extensions end their login. The inference API
accepts the OAuth access token directly, so toAuth hands it over and
no agent key is ever minted or stored.

- Device-code OAuth (subscription) and API-key login
- Live model discovery delegated to openai-completions streaming
- Offline baseline so pi -p and --list-models stay usable
- /nous-catalog cycles full, free and promo; /nous-free jumps to free
2026-11-25 09:29:52 +01:00

944 B

Nous Portal as a native pi-ai provider extension

Pi 1.6 exposes two registration forms. We register a complete native Provider (built with createProvider from @earendil-works/pi-ai) rather than the legacy ProviderConfig + oauth block, because the legacy form's getApiKey contract pushes an extension toward minting a session key, and Nous retired that endpoint (HTTP 410 session_key_minting_retired, verified 2026-11-25). The native form lets toAuth hand the OAuth access token straight to inference, which accepts it (verified 200 on /v1/models). Streaming is delegated to the built-in openai-completions API; no custom wire protocol.

Consequences

  • Pi owns the locked refresh pattern (refresh / toAuth split), so concurrent requests cannot double-refresh a rotated token.
  • The extension is a single root index.ts with no build step, matching the sibling extensions in ~/Projects/scripting/pi-extensions/.