Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.43.0"
".": "2.43.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.43.1 (2026-06-17)

Full Changelog: [v2.43.0...v2.43.1](https://github.com/openai/openai-python/compare/v2.43.0...v2.43.1)

### Bug Fixes

* **auth:** prioritize first auth header ([797e336](https://github.com/openai/openai-python/commit/797e3362e222ae14e587a4543b76a54d8992d66c))

## 2.43.0 (2026-06-17)

Full Changelog: [v2.42.0...v2.43.0](https://github.com/openai/openai-python/compare/v2.42.0...v2.43.0)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "2.43.0"
version = "2.43.1"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -11,7 +11,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.11, <5", "typing-extensions>=4.14, <5",
"typing-extensions>=4.14, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
Expand Down
26 changes: 12 additions & 14 deletions src/openai/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,14 @@ def _send_request(

@override
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
headers: dict[str, str] = {}
if security.get("bearer_auth", False):
headers = self._bearer_auth
if headers:
return headers

for key, value in self._bearer_auth.items():
headers.setdefault(key, value)
if security.get("admin_api_key_auth", False):
return self._admin_api_key_auth

return {}
for key, value in self._admin_api_key_auth.items():
headers.setdefault(key, value)
return headers

@property
def _bearer_auth(self) -> dict[str, str]:
Expand Down Expand Up @@ -947,15 +946,14 @@ async def _send_request(

@override
def _auth_headers(self, security: SecurityOptions) -> dict[str, str]:
headers: dict[str, str] = {}
if security.get("bearer_auth", False):
headers = self._bearer_auth
if headers:
return headers

for key, value in self._bearer_auth.items():
headers.setdefault(key, value)
if security.get("admin_api_key_auth", False):
return self._admin_api_key_auth

return {}
for key, value in self._admin_api_key_auth.items():
headers.setdefault(key, value)
return headers

@property
def _bearer_auth(self) -> dict[str, str]:
Expand Down
2 changes: 1 addition & 1 deletion src/openai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openai"
__version__ = "2.43.0" # x-release-please-version
__version__ = "2.43.1" # x-release-please-version
Loading
Loading