https://gateway.ngrok.ai/v1 and it can call a self-hosted model on your own machine, a hosted GPU, or anywhere else it can run.
What you’ll need
- The ngrok agent installed on the machine where your model runs
- An access key from app.ngrok.ai
- A model server such as Ollama, LM Studio, or vLLM
Getting started
1
Register your model with the gateway
Expose your model server with an ngrok internal endpoint.
For a server listening on port Create a custom provider in app.ngrok.ai:
11434:- Go to Providers and open the Custom tab.
- Select Add provider.
- Enter a provider ID, the base URL, the API format, and your model IDs.
- Add a provider key if the upstream requires authentication.
2
Connect your agent
Every agent below needs the same three values:
- OpenCode
- Zed
- Pi
- Cursor
- Anything else
OpenCode is a terminal coding agent.Add the gateway as a provider in Replace these required fields:
~/.config/opencode/opencode.json, or in an opencode.json beside your project:apiKeywith your ngrok.ai access key- Keys in the
modelsfield with your fullprovider:modelname and display-friendly name
ngrok/ollama:llama3.2 with your model:Next steps
- Restrict providers and models: Scope what an access key can call
- Observability: See which model served each request
- Configure fallback models: Try another model when the first one fails