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 ↗

6 Comments

kruucian · 1 year ago

How about internal root cert?

ketank1000 · 1 year ago

yes I have those as well REQUESTS_CA_BUNDLE , SSL_CERT_FILE

kruucian · 1 year ago

No it's NODE_EXTRA_CA_CERTS

ketank1000 · 1 year ago

even adding DEBUG and the NODE_EXTRA_CA_CERTS

im getting this response.

{
  accept: 'application/json',
  'content-type': 'application/json',
  'user-agent': 'Ir/JS 4.100.0',
  'x-stainless-lang': 'js',
  'x-stainless-package-version': '4.100.0',
  'x-stainless-os': 'Linux',
  'x-stainless-arch': 'x64',
  'x-stainless-runtime': 'node',
  'x-stainless-runtime-version': 'v22.16.0',
  authorization: 'REDACTED',
  'x-stainless-retry-count': '2',
  'x-stainless-timeout': '600'
}
ketank1000 · 1 year ago

I found out that out llm supports completion calls, can codex uses response calls.

Any way to make codex use completion calls ?

codex-maintainers · 1 year ago

Thank you for the feedback! Please try using the latest version of Codex CLI. If the issue persists, let us know, and we can investigate further.