Skip to main content
Prerequisite: Complete the Quickstart to create an access key on app.ngrok.ai.
Coding agents that let you change their base URL can send their model requests through the AI Gateway. Each agent then authenticates with an ngrok.ai access key instead of a separate provider account, and every request shows up in one place. Routing agents through the gateway gives you:
  • One access key for every provider in the model catalog, billed to your credits or your own provider keys
  • Per-request observability, with usage you can group by access key
  • Fallback models and automatic retries when a provider fails
  • Limits on which providers and models each key can call
  • A path to models you run yourself, such as Ollama or vLLM

Supported agents

Claude Code

Anthropic’s agentic coding tool, configured with two environment variables

Codex

OpenAI’s terminal coding agent, configured as a custom model provider

Cursor

AI code editor, configured with an OpenAI base URL override

Hermes

Nous Research’s terminal agent, configured with the ngrok plugin

OpenCode

Open-source terminal agent, configured as a custom provider

Pi

Terminal coding agent, configured in its models file

Zed

Code editor with an agent panel, configured as an OpenAI-compatible provider

Other agents

Any agent that accepts a custom OpenAI or Anthropic base URL

How each agent connects

Each agent speaks one API format, which decides the base URL it needs: The format also decides which models an agent can reach. Chat Completions reaches the most providers. The Messages and Responses formats only reach providers that support them, so Claude Code works with Claude models and Codex works best with OpenAI models.

Set up for agent traffic

Coding agents send long, streaming requests, often many per task. A few settings keep that traffic manageable:
  • Create a separate access key for each agent or teammate, so you can group usage by access key and revoke one without touching the others.
  • Set totalTimeout to 15m in account settings. A saved total timeout caps the whole stream, and saving any account setting stores the 2m default, which can cut off a long agent response.
  • Scope each key to the models it needs with an access key configuration.

Next steps