Feb 4, 2026
Codegen support for per-endpoint security

Robert Craigie
Software Engineer
If your OpenAPI spec looks like this:
And your stainless config looks like this:
When instantiating the SDK with both options:
Previously, the SDK sent both the api-key and Authorization headers, which could cause authentication errors depending on how your API handles multiple authentication schemes.
Now the SDK will only send the Authorization header, as that is the only scheme configured for that endpoint in security.
This is enabled by default for new projects, to enable this for existing projects update the edition in your config to 2026-01-30 or higher: