Install
Install with PiG
pig install npm:@cloudflare/aig-pi-extensionInstall with Pi
pi install npm:@cloudflare/aig-pi-extensionPackages 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": [
"./src/index.ts"
]
}README
Written by the package's publisher, shown as published in version 2026.11.18 (README.md). PiG does not review it.
Cloudflare AI Gateway extension for Pi
Adds the cloudflare/auto Smart Router model to Pi through Cloudflare's internal AI gateway. It records routing diagnostics silently and shows the latest decision on demand through /aig-show, without occupying persistent UI space. It registers an isolated provider without replacing Pi's built-in provider or model catalog.
Prerequisites
cloudflared- Cloudflare Access entitlement to
opencode.cloudflare.dev - Pi 0.84.4
Authentication uses the same pinned cloudflared access login flow as pi-cf-internal-gateway. Tokens remain in memory and are not written to Pi's credential store.
Install
pi install ./packages/aig-pi-extension
Select cloudflare-auto/cloudflare/auto with /model or start Pi with:
pi --model cloudflare-auto/cloudflare/auto
Pi estimates cost using the internal catalog's cloudflare/auto rate. AI Gateway billing and logs report the concrete routed model and actual cost.