Skip to content

feat: add custom session/client injection for proxy authentication#159

Merged
yashb1708 merged 2 commits intomasterfrom
feat/custom-session-injection
Mar 9, 2026
Merged

feat: add custom session/client injection for proxy authentication#159
yashb1708 merged 2 commits intomasterfrom
feat/custom-session-injection

Conversation

@yashb1708
Copy link
Contributor

Allow users to pass a pre-configured requests.Session or httpx.AsyncClient
to TavilyClient, AsyncTavilyClient, and TavilyHybridClient. This enables
enterprise environments that proxy Tavily traffic through API gateways to
use their own auth headers without needing a Tavily API key. When a custom
session/client is provided, api_key becomes optional, external sessions are
not closed by the SDK, and custom headers/proxies take precedence over defaults.

  Allow users to pass a pre-configured requests.Session or httpx.AsyncClient
  to TavilyClient, AsyncTavilyClient, and TavilyHybridClient. This enables
  enterprise environments that proxy Tavily traffic through API gateways to
  use their own auth headers without needing a Tavily API key. When a custom
  session/client is provided, api_key becomes optional, external sessions are
  not closed by the SDK, and custom headers/proxies take precedence over defaults.
@yashb1708
Copy link
Contributor Author

Fixes TAV-5269

@yashb1708 yashb1708 merged commit d81b56f into master Mar 9, 2026
6 checks passed
@yashb1708 yashb1708 deleted the feat/custom-session-injection branch March 9, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants