Skip to main content

Set up

agentgateway is an open-source AI gateway that runs in your own cluster. Solo.io’s enterprise edition and Gloo AI Gateway are builds of the same project, so the same recipe covers all three. The gateway has no public address for the SDK to recognize, so pass the agentgateway recipe with your gateway’s base URL:
The gateway also answers on Anthropic’s Messages API. Wrap an Anthropic client pointed at the gateway’s root, with the same recipe, and its calls are governed the same way:
To call the gateway with plain HTTP instead of a client, see A gateway you call over HTTP.
  • Always pass baseUrl for Solo.io and Gloo builds. Without it, the SDK recognizes the gateway only when a part of its hostname is agentgateway or starts with agentgateway-, as in a default install’s agentgateway-proxy.agentgateway-system.svc.
  • Tell deployments apart with a dimension. Every build reports under the same agentgateway.* event names. To separate Solo.io traffic from another agentgateway deployment, add a dimension such as gateway: 'solo-enterprise' to the stiggContext.

agentgatewayRecipe options

What is reported

agentgateway is a gateway you host: one endpoint in front of many model providers, answering in OpenAI’s format and in Anthropic’s. Each route reports the token counts of the format it answered in. The gateway puts no price on its responses, so there is no cost metric. Each provider charges you directly for what its models served.
  • Chat Completions and Responses report the same metrics as OpenAI.
  • Messages reports the same metrics as Anthropic.
Each event also carries:
A streamed Chat Completions call carries usage only when the request sets stream_options: { include_usage: true }. Without it, a streamed call reports nothing.
Every usage field the gateway returns is also included, with a raw. prefix. See How usage is reported.