Skip to content

Enhance Tavily API clients to accept optional project_id parameter#148

Merged
guy-hartstein merged 1 commit intomasterfrom
feat/add-x-project-id
Jan 14, 2026
Merged

Enhance Tavily API clients to accept optional project_id parameter#148
guy-hartstein merged 1 commit intomasterfrom
feat/add-x-project-id

Conversation

@guy-hartstein
Copy link
Contributor

This pull request adds support for specifying a project_id when initializing both the synchronous and asynchronous Tavily API clients. The project_id can be provided directly or through the TAVILY_PROJECT environment variable, and is included in the request headers as X-Project-ID if present.

Project ID support

  • Added an optional project_id parameter to the TavilyClient and AsyncTavilyClient (async_tavily.py and tavily.py) constructors, allowing users to specify a project context for API requests. ([[1]](https://github.com/tavily-ai/tavily-python/pull/148/files#diff-d60fbf8e5f5ed7f347956181215dfc5c29b26102847f0465d81b2d84d8297a6aL15-R15), [[2]](https://github.com/tavily-ai/tavily-python/pull/148/files#diff-5a3f5c171e5af051aa3cc8c4a6f4f34d05584210884e96a6fa235b0613cbb832L21-R22))
  • The project_id value is resolved from the argument or the TAVILY_PROJECT environment variable, and if present, is added to the request headers as X-Project-ID. ([[1]](https://github.com/tavily-ai/tavily-python/pull/148/files#diff-d60fbf8e5f5ed7f347956181215dfc5c29b26102847f0465d81b2d84d8297a6aR28-R38), [[2]](https://github.com/tavily-ai/tavily-python/pull/148/files#diff-5a3f5c171e5af051aa3cc8c4a6f4f34d05584210884e96a6fa235b0613cbb832R44-R53))

@guy-hartstein guy-hartstein merged commit 88200a4 into master Jan 14, 2026
8 checks passed
@guy-hartstein guy-hartstein deleted the feat/add-x-project-id branch January 14, 2026 16:15
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