What you’ll need
- Pi installed.
- An access key from app.ngrok.ai.
Add the gateway as a provider
Export your access key so Pi can read it:~/.pi/agent/models.json:
id is the model name Pi sends to the gateway: a model ID from the model catalog, or provider:model to pin a provider.
It’s the only field a model entry needs, though you can add name, contextWindow, and maxTokens to label it and track context accurately.
Test the connection
Send a single prompt from the command line:/model and pick one of the ngrok models instead.
Confirm the request in AI Gateway observability in app.ngrok.ai.
Use a model you run yourself
To reach a model on your own machine, register it as a custom provider, then add itsprovider:model name to models, such as ollama:llama3.2.
See Use a model you run yourself for the full setup.
Next steps
- Restrict providers and models: Scope what an access key can call
- Configure fallback models: Try another model when the first one fails
- Observability: See which model served each request