AI Gateway overview
What an AI gateway is, and how model calls reach providers through /gateway/llm.
When agents call models straight from each provider, each with its own keys, nothing decides which models they use or records the calls they make. An AI gateway, also called an LLM gateway, sits between your agents and the model providers, so every model call passes through one place you control.
What is an AI gateway?
In Agent Authority, agents send model calls to the gateway at /gateway/llm, not to the provider.
The gateway accepts calls in the OpenAI and Anthropic API formats.
MCP tool calls go through the MCP Gateway instead.
What happens to a model call
The gateway applies these steps in order:
- It identifies the agent and the user from the call's credential.
- It finds the Model Providers connections that serve the requested model, after any model route sends the call to another model or provider. If none does, it refuses the call.
- It checks your model access rules, and a call that no rule allows is denied.
- It applies data protection filters to the prompt, which can redact it or block the call.
- It checks your usage limits, and refuses a call over a limit with a 429.
- It sends the call to the provider with the connection's API key, or with the user's own sign-in on a sign-in connection. Data protection filters also apply to the response.
- It records the call as an event. When an audit policy covers the call, the record also holds the prompt.
The gateway records each call from a signed-in agent, including denied calls and streams cut off partway.
When a key moves to another agent
A key created for one agent is often used from another client, so its calls would show under two agents. When the gateway forwards a call from a client it recognizes, such as Claude Code or Codex, and that client differs from the key's agent type, the key moves to the person's agent for that client. An autonomous agent changes type instead. A key on a custom agent's own type stays on that type. A call the gateway refuses or denies moves nothing. The Agents tab then shows the key, its policies and its usage under one agent, seen in LLM. An agent the move leaves empty is removed if only MCP and the LLM gateway had seen it. The key keeps its name, and the call after the move uses the new agent's policies.
Next steps
You can now follow a model call from the agent, through the rules, to the provider. Write your first rule in Model access rules.