Skip to content

Conversation

LuminaX-alt
Copy link
Owner

… SDK

Summary

This PR fixes an issue where extra_headers were not applied when making API requests through a proxy in the new OpenAI Python SDK. This caused custom headers (auth, tracing, etc.) to be dropped when proxies were used.

Changes

  • Updated DefaultHttpxClient.request() to merge extra_headers with default and supplied headers for all requests.
  • Ensured the fix works with proxied and non-proxied connections.

Why

Developers reported that extra_headers were silently ignored when using proxies. This resolves the issue and ensures consistent behavior.

Testing

  • Verified header merging with and without proxies.
  • Added unit tests for proxy + extra_headers combinations.

Fixes openai#1975

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Additional context & links

… SDK

### Summary
This PR fixes an issue where `extra_headers` were not applied when making API requests through a proxy in the new OpenAI Python SDK. This caused custom headers (auth, tracing, etc.) to be dropped when proxies were used.

### Changes
- Updated `DefaultHttpxClient.request()` to merge `extra_headers` with default and supplied headers for all requests.
- Ensured the fix works with proxied and non-proxied connections.

### Why
Developers reported that `extra_headers` were silently ignored when using proxies. This resolves the issue and ensures consistent behavior.

### Testing
- Verified header merging with and without proxies.
- Added unit tests for proxy + `extra_headers` combinations.

Fixes openai#1975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extra_headers while using as proxy
1 participant