OpenAI Workload Identity Federation: Keyless API Auth for CI/CD & Coding Agents — Plus Admin API Model Allowlists, Spend Alerts
OpenAI workload identity federation lets CI/CD pipelines exchange OIDC tokens for short-lived API keys — no stored credentials. The Admin API adds model allowlists per project, spend alerts, and granular billing line items. Full operator checklist inside.
Archive item produced with AI assistance from the cited source and published without individual review. Editor of record: Joe Werner.

Two changes landed in the OpenAI API on May 26 that most teams haven't fully processed yet. The first is workload identity federation — a keyless authentication mechanism that lets CI/CD pipelines, cloud functions, and agent runtimes exchange OIDC tokens for short-lived OpenAI access tokens without ever storing a long-lived API key. The second is a set of Admin API additions: per-project model allowlists, spend alerts, data retention controls, and granular billing line items. Neither change is a model release, but together they shift the governance posture for any team running OpenAI at scale.
What happened
On May 26, OpenAI shipped two distinct but related governance features:
Workload identity federation lets trusted workloads exchange externally issued OIDC JWT tokens for short-lived OpenAI access tokens. The flow has four parts: you register a workload identity provider (your OIDC issuer, audience, and key source), create service account mappings that authorize specific token attributes to mint OpenAI tokens, configure your workload to perform the token exchange, and use the resulting short-lived bearer token for API calls. The feature is available at Organization Settings > Security > Workload Identity Provider. Supported providers include AWS, GCP, Azure, GitHub Actions, and any OIDC-compatible issuer.
Admin API expansion added four new capabilities:
- Model allowlists/denylists per project: set
mode: "allow_list"with specific model IDs to restrict which models a project can call, ormode: "deny_list"to block specific models while allowing everything else. - Spend alerts: configure per-project monthly spend thresholds with email notifications. Threshold amounts are in cents.
- Data retention controls: override or inherit the organization's retention policy at the project level.
- Granular billing line items: query billing data at a finer granularity than the existing usage dashboard.
These Admin API features require an Admin API key (separate from regular API keys) and are available in Node SDK 6.36.0+, Python SDK 2.34.0+, Go 3.34.0+, Ruby 0.61.0+, and Java 4.34.0+.
Why it matters for AI engineering teams
Long-lived API keys are the single biggest credential risk in AI infrastructure. Most teams today store OpenAI API keys as environment variables or secrets manager entries, rotate them manually, and share them across services. Workload identity federation eliminates this pattern for workloads that already have an OIDC identity — which includes virtually every modern CI/CD pipeline, cloud function, and Kubernetes workload. The short-lived tokens expire automatically; there is nothing to rotate, nothing to leak in a git commit, and nothing to revoke after a breach.
For teams running coding agents (Codex, Claude Code, or similar) in CI, this is particularly relevant. These agents make large numbers of API calls and often run in environments where secret management is operationally complex. An OIDC-based flow ties the API access to the workload's existing cloud identity rather than a separate credential.
Model allowlists are a routing governance primitive. The ability to restrict which models a project can call via API — not just via the dashboard — means you can enforce model policy programmatically. A project that should only use gpt-4.1 for cost reasons can be locked to that model at the API level, not just by convention. A project that should never call o3 for latency reasons can have it blocked. This is the kind of control that previously required a proxy layer to enforce.
Spend alerts close the gap between usage and billing. The existing usage dashboard shows consumption after the fact. Per-project spend alerts with configurable thresholds and email notifications let teams catch runaway usage before it becomes a billing surprise. Combined with granular billing line items, this gives finance and platform teams the data they need for chargeback and cost attribution without building custom usage-scraping pipelines.
The router/operator angle
For teams routing OpenAI traffic through a gateway, these changes create both opportunities and new configuration surface:
Keyless auth changes the credential model for your gateway. If your gateway currently injects an OpenAI API key into outbound requests, workload identity federation offers an alternative: configure the gateway itself as a trusted workload, exchange its cloud identity for a short-lived OpenAI token, and use that token for the duration of a request batch. This eliminates the gateway's dependency on a stored API key. The tradeoff is that the token exchange adds a round-trip latency cost and requires the gateway to have an OIDC identity — which is straightforward on AWS/GCP/Azure but requires setup.
Model allowlists interact with your routing policy. If you route requests across multiple OpenAI projects (for example, one project per team or per cost center), model allowlists let you enforce different model policies per project at the API level. A routing rule that sends requests to project_a for GPT-5.5 and project_b for GPT-4.1 can now be backed by API-level enforcement rather than relying on the gateway to correctly route every request. This is defense in depth for routing policy.
Spend alerts are a complement to gateway-level rate limiting. Gateway rate limits protect against burst traffic; spend alerts protect against sustained high-cost usage that stays within rate limits. A team that has a $500/month budget for a project can set a spend alert at $400 to get early warning. This is particularly useful for agent workloads where a single runaway job can consume a month's budget in hours.
Billing line items enable reconciliation without scraping. If your platform team does chargeback by project or by team, the new granular billing line items give you a structured API to pull that data rather than parsing the usage dashboard. This is a meaningful operational improvement for teams with more than a handful of projects.
Operator checklist for the May 26 changes:
-
Audit your API key storage. Identify which workloads use long-lived OpenAI API keys and which have an existing OIDC identity (AWS IAM role, GCP service account, GitHub Actions OIDC, etc.). Workloads with OIDC identities are candidates for migration to workload identity federation.
-
Set model allowlists for cost-sensitive projects. If you have projects where model selection is a cost control issue, configure allowlists now. This is a one-time setup that provides ongoing enforcement.
-
Configure spend alerts before the next billing cycle. Set thresholds at 80% of your expected monthly spend per project. The email notification is a low-friction early warning system.
-
Update your Admin API SDK versions. The new features require Node 6.36.0+, Python 2.34.0+, Go 3.34.0+, Ruby 0.61.0+, Java 4.34.0+. Check your current versions before writing automation against the new endpoints.
-
Evaluate gateway credential architecture. If your gateway stores OpenAI API keys, assess whether workload identity federation is a better fit for your security posture. The token exchange adds latency but eliminates credential rotation overhead.
What TheRouter users should watch or try
For teams using TheRouter to route across multiple providers including OpenAI, the model allowlist feature is worth integrating into your governance model. If you use separate OpenAI projects per team or per use case, model allowlists let you enforce routing policy at two layers: TheRouter's routing rules and OpenAI's project-level API enforcement. This is belt-and-suspenders governance for model selection.
The workload identity federation feature is most relevant if your TheRouter deployment runs in a cloud environment with an existing OIDC identity. In that case, you can eliminate the stored OpenAI API key from your TheRouter configuration and replace it with a token exchange flow. This is a security improvement worth evaluating for production deployments.
Watch the OpenAI API changelog for further Admin API additions — the May 26 release added spend alerts and model allowlists, but the pattern suggests more programmatic governance controls are coming.

OpenAI Now Lets You Create Scoped API Keys Per Service Account — What Every Multi-Project Operator Must Know
OpenAI Python SDK v2.46.0 ships a new endpoint to create and list API keys scoped to individual project service accounts. For teams managing multi-project AI routing, this closes a credential-sprawl gap that forced org-wide keys on pipeline workloads.

OpenAI API Key Cost Attribution Is Now Programmable: What Every Routing Operator Must Change
OpenAI added the api_key dimension to its Usage and Costs APIs on August 4. For routing teams running multiple keys per organization, this closes the biggest gap in per-path cost attribution — without needing separate orgs.

OpenAI Ships an Official Terraform Provider: The IaC Governance Pattern AI Gateway Teams Have Been Waiting For
OpenAI's official Terraform provider, released July 29, lets teams manage projects, service accounts, rate limits, model controls, and spend alerts as code. Here is the routing-layer topology pattern that gets you there.