openai (RFC 8693 token exchange) and anthropic
(RFC 7523 jwt-bearer). Set up the identity provider and service account on the
provider side first:
OpenAI,
Anthropic.
Configure
Anthropic reads the same variables as the official SDKs, so an existing deployment works unchanged:config.yaml:
OPENAI_EU_IDENTITY_TOKEN_FILE for a provider named openai-eu.
How it works
- The first request waits for the identity token exchange. The access token is cached and refreshed in the background two minutes before it expires (earlier for very short-lived tokens), while requests keep using the cached token. A request waits for an exchange only when no usable token is cached.
identity_token_fileis re-read on every exchange, so tokens that rotate on disk stay current. When both the file andidentity_tokenare set, the file wins.- If a refresh fails, the cached token keeps being used until 30 seconds before it expires. After a failure, the gateway waits 5 seconds before it tries the exchange again.
- If no valid token is available, the request goes out without one and the
provider rejects it. The gateway log says why
(
workload identity token exchange failed). - The exchange uses the provider’s outbound proxy when one is configured.
- Neither the identity token nor the access token is ever logged.
Rules
- An API key wins over workload identity, as in the official SDKs. GoModel
logs a warning when both are set. Unset
<PROVIDER>_API_KEYwhen you migrate. - A config provider with
workload_identitydoes not pick up a bare<PROVIDER>_API_KEYfrom the environment unless it is named after its type. - A missing required field, or
workload_identityon another provider type, stops that provider from starting, and the log names the field. - Workload identity is configured in
config.yamlor environment variables. It is not available in the dashboard provider editor yet.