@aliou/pi-ts-aperture
Route Pi LLM providers through Tailscale Aperture
Package details
Install @aliou/pi-ts-aperture from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@aliou/pi-ts-aperture- Package
@aliou/pi-ts-aperture- Version
0.5.1- Published
- Apr 27, 2026
- Downloads
- 529/mo · 229/wk
- Author
- aliou
- License
- MIT
- Types
- extension
- Size
- 29.2 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
],
"video": "https://assets.aliou.me/pi-extensions/demos/pi-ts-aperture.mp4"
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README

pi-ts-aperture
Route Pi LLM providers through Tailscale Aperture, a managed AI gateway on your tailnet.
Aperture handles API key injection and request routing server-side. This extension overrides selected providers so requests go through your Aperture gateway instead of directly to upstream provider APIs.
Setup
pi install npm:@aliou/pi-ts-aperture
Then run the setup wizard:
/aperture:setup
This prompts for:
- Aperture base URL (for example
ai.your-tailnet.ts.net) - Providers to route through Aperture (fuzzy searchable, multi-select)
Configuration is saved globally to ~/.pi/agent/extensions/aperture.json.
Commands
| Command | Description |
|---|---|
/aperture:setup |
Interactive wizard to configure Aperture URL and routed providers |
/aperture:settings |
Settings UI to update URL and routed provider list |
How it works
For each configured provider, the extension calls registerProvider with:
baseUrlset to your Aperture URL +/v1(OpenAI-compatible surface used by Pi provider configs)apiKeyset to"-"(Aperture injects upstream credentials server-side)- provenance headers:
Referer: https://pi.devX-Title: npm:@aliou/pi-ts-aperture
Additionally, the extension can bootstrap model IDs discovered from Aperture (/api/providers) for providers like OpenRouter so CLI model selection can resolve Aperture-exposed model IDs before the first prompt.
Requirements
- A Tailscale tailnet with Aperture configured
- The device running Pi must be on the tailnet (or otherwise able to reach your Aperture endpoint)
- Use the URL/scheme that matches your deployment (
http://orhttps://)