Proxy setup for OpenAI API behind corporate firewall

Robert Chang
Robert ChangMar 3, 2026

Our company network requires all outbound traffic to go through a corporate proxy. I'm struggling to configure the OpenAI Python SDK to work with it.

I've tried setting http_proxy and https_proxy environment variables but still getting connection timeouts.

import os
os.environ["HTTPS_PROXY"] = "http://proxy.corp.example.com:8080"

from openai import OpenAI client = OpenAI() # Times out

Has anyone successfully configured this? Do I need to pass the proxy config directly to the httpx client?

1.9k views11 replies23 likesSolved
3 Replies
Dr. Anna Kowalski

This is excellent benchmarking work. Would you be willing to share the test suite? I'd love to run it against o1-preview for the complex tasks.

Derek Frost

I'm working on packaging it up. Will share a GitHub link once it's cleaned up. The test cases cover:

  • Algorithm implementation
  • Bug fixing
  • Code translation
  • Refactoring
  • Documentation generation
  • Chris Nakamura

    Interesting that the latency difference is almost 3x. In real-time applications this makes GPT-4o the clear winner even if GPT-4 Turbo was slightly more accurate.

    Log in to reply to this topic.