openai-node icon indicating copy to clipboard operation
openai-node copied to clipboard

Enable the use of OpenAI with custom authentication in scenarios where a proxy is in place before accessing the OpenAI service.

Open tpamsler opened this issue 10 months ago • 1 comments

Confirm this is a feature request for the Node library and not the underlying OpenAI API.

  • [x] This is a feature request for the Node library

Describe the feature or improvement you're requesting

Enable the use of OpenAI with custom authentication in scenarios where a proxy is in place before accessing the OpenAI service.

  1. Initialize OpenAI with a custom authentication token and send a request to a proxy that handles the POST /api/chat/completions API.
  2. The proxy validates the custom authentication token and forwards the request to OpenAI using the actual OpenAI API key.

Additional context

No response

tpamsler avatar Feb 13 '25 23:02 tpamsler

You can configure proxies today, have you tried that? https://github.com/openai/openai-node?tab=readme-ov-file#configuring-an-https-agent-eg-for-proxies

RobertCraigie avatar Feb 14 '25 11:02 RobertCraigie

The proxy setup has changed slightly in v5 fyi https://github.com/openai/openai-node#configuring-proxies

Closing this, please re-open if configuring a proxy does not work for you use case!

RobertCraigie avatar Jul 10 '25 11:07 RobertCraigie