[GH-ISSUE #68] Add support for proxy for openai/gemini modes #33

Open
opened 2026-03-03 13:52:22 +03:00 by kerem · 2 comments
Owner

Originally created by @fireattack on GitHub (Aug 29, 2024).
Original GitHub issue: https://github.com/jehna/humanify/issues/68

As title.

These services are geo-locked to only some countries and many people need to use proxy to visit them, including API endpoints.

Originally created by @fireattack on GitHub (Aug 29, 2024). Original GitHub issue: https://github.com/jehna/humanify/issues/68 As title. These services are geo-locked to only some countries and many people need to use proxy to visit them, including API endpoints.
Author
Owner
<!-- gh-comment-id:2319732553 --> @0xdevalias commented on GitHub (Aug 30, 2024): Related: - https://github.com/openai/openai-node/issues/85 - > Our upcoming v4 also has support for proxies, as documented here: > - https://github.com/openai/openai-node/tree/v4#configuring-an-https-agent-eg-for-proxies > > _Originally posted by @rattrayalex in https://github.com/openai/openai-node/issues/85#issuecomment-1627939433_ - https://github.com/openai/openai-node#configuring-an-https-agent-eg-for-proxies - https://github.com/google-gemini/generative-ai-js/issues/16 - https://github.com/google-gemini/generative-ai-js/pull/38
Author
Owner

@0xdevalias commented on GitHub (May 30, 2025):

For openai proxy support, see also this thread:

Of which this most recent update I added is most relevant:

Looks like openai v5 is out now, which uses the native fetch, and has better support for proxies:

Here's some updates on the timeline as to when node-fetch will no longer be included in it, which I believe will resolve this error:

seems that openai is still using node-fetch, so it might not work

Looks like openai v5 is officially out, which moves to the built-in fetch:

We can see the migration guide here:

We can see that it now supports a new fetchOptions property for customizing the underlying fetch:

fetchOptions is also the basis for how to configure proxies now:

Originally posted by @0xdevalias in https://github.com/jehna/humanify/issues/52#issuecomment-2921148059

Originally posted by @0xdevalias in https://github.com/jehna/humanify/issues/265#issuecomment-2921150326

<!-- gh-comment-id:2921153583 --> @0xdevalias commented on GitHub (May 30, 2025): For `openai` proxy support, see also this thread: - https://github.com/jehna/humanify/issues/265 Of which this most recent update I added is most relevant: > Looks like `openai` v5 is out now, which uses the native `fetch`, and has better support for proxies: > > > > Here's some updates on the timeline as to when `node-fetch` will no longer be included in it, which I believe will resolve this error: > > > > > > > > seems that openai is still using `node-fetch`, so it might not work > > > > > > > > - https://github.com/openai/openai-node/blob/212710db8c8c139392c6532c0eccfd13558ef2d4/README.md?plain=1#L1-L5 > > > > - > We're actively working on a new alpha version that migrates from `node-fetch` to builtin `fetch`. > > > > > > > > > > Please try it out and let us know if you run into any issues! > > > > > > > > > > - https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774 > > > > - > **We’re pleased to share that a new alpha of the 5.0.0 version of the JavaScript / TypeScript SDK is [available on npm](https://www.npmjs.com/package/openai/v/5.0.0-alpha.0) and in the [alpha branch of the GitHub repository](https://github.com/openai/openai-node/tree/alpha)**. This version of the SDK represents a breaking change to the existing 4.x SDK, as **we have migrated completely to using built-in `fetch` for HTTP requests across all environments** (Node.js, Deno, etc). However, we do expect that most of your code will “just work” with minor adjustments in types. > > > > Looks like `openai` v5 is officially out, which moves to the built-in `fetch`: > > > > - https://github.com/jehna/humanify/pull/459 > > - https://github.com/openai/openai-node/releases/tag/v5.0.0 > > - https://github.com/openai/openai-node/blob/master/CHANGELOG.md#500-2025-05-29 > > - https://github.com/openai/openai-node/releases/tag/v5.0.1 > > - https://github.com/openai/openai-node/blob/master/CHANGELOG.md#501-2025-05-29 > > > > We can see the migration guide here: > > > > - https://github.com/openai/openai-node/blob/master/MIGRATION.md > > - > The main changes are that the SDK now relies on the [builtin Web fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) instead of `node-fetch` and has zero dependencies. > > > > We can see that it now supports a new `fetchOptions` property for customizing the underlying `fetch`: > > > > - https://github.com/openai/openai-node/blob/master/MIGRATION.md#removed-httpagent-in-favor-of-fetchoptions > > - > Removed `httpAgent` in favor of `fetchOptions` > > > > > > The `httpAgent` client option has been removed in favor of a [platform-specific `fetchOptions` property](https://github.com/openai/openai-node#fetch-options). This change was made as `httpAgent` relied on `node:http` agents which are not supported by any runtime's builtin `fetch` implementation. > > > > > > If you were using `httpAgent` for proxy support, check out the [new proxy documentation](https://github.com/openai/openai-node#configuring-proxies). > > - https://github.com/openai/openai-node#fetch-options > > - > Fetch options > > > If you want to set custom fetch options without overriding the fetch function, you can provide a fetchOptions object when instantiating the client or making a request. (Request-specific options override client options.) > > > > `fetchOptions` is also the basis for how to configure proxies now: > > > > - https://github.com/openai/openai-node#configuring-proxies > > - > Configuring proxies > > > > > > To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy options to requests: > > > > _Originally posted by @0xdevalias in https://github.com/jehna/humanify/issues/52#issuecomment-2921148059_ > > _Originally posted by @0xdevalias in https://github.com/jehna/humanify/issues/265#issuecomment-2921150326_
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/humanify#33
No description provided.