Skip to main content
Workload identity federation is in beta. It has not yet been verified against every platform, and its configuration may change. Static API keys remain the most stable option.
Workload identity federation lets GoModel authenticate to a provider without a long-lived API key. The gateway reads an identity token your platform already issues (a Kubernetes projected service-account token, AWS, GCP, or Azure workload identity, GitHub Actions OIDC, a SPIFFE JWT-SVID) and exchanges it for a short-lived provider access token. Supported providers: 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:
OpenAI:
Or in config.yaml:
Instance suffixes work like every other provider setting, for example 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_file is re-read on every exchange, so tokens that rotate on disk stay current. When both the file and identity_token are 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_KEY when you migrate.
  • A config provider with workload_identity does not pick up a bare <PROVIDER>_API_KEY from the environment unless it is named after its type.
  • A missing required field, or workload_identity on another provider type, stops that provider from starting, and the log names the field.
  • Workload identity is configured in config.yaml or environment variables. It is not available in the dashboard provider editor yet.
Last modified on October 25, 2026