Fails to connect to llm proxy in secured network.

Resolved 💬 6 comments Opened May 20, 2025 by ketank1000 Closed Aug 7, 2025

We have llm proxy hosted in corporate network, where we have user level api key.

Is codex supported in secured network ? if yes how to pass user to llm proxy endpoint.

from openai import OpenAI
client = OpenAI(
    base_url = "https://llm-proxy-api.ai.mycompany.com",
    api_key  = "userkey"
)
completion =  client.chat.completions.create(
                    model    = "gpt-4o",
                    messages = [{ "role"   : "user",
                                  "content": "Write a function that prints n primes in python"}],
                    user     = "User"
                )
print(completion.choices[0].message.content)

The above code works perfectly. but codex fails somewhere in network api.

OPENAI_API_KEY, OPENAI_BASE_URL were also set peoperly

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗