diff --git a/extensions/tavily/src/tavily-client.ts b/extensions/tavily/src/tavily-client.ts index c57f5850af3..867e1e3deaa 100644 --- a/extensions/tavily/src/tavily-client.ts +++ b/extensions/tavily/src/tavily-client.ts @@ -119,6 +119,7 @@ export async function runTavilySearch( apiKey, body, errorLabel: "Tavily Search", + extraHeaders: { "X-Client-Source": "openclaw" }, }, async (response) => (await response.json()) as Record, ); @@ -200,6 +201,7 @@ export async function runTavilyExtract( apiKey, body, errorLabel: "Tavily Extract", + extraHeaders: { "X-Client-Source": "openclaw" }, }, async (response) => (await response.json()) as Record, ); diff --git a/src/agents/tools/web-search-provider-common.ts b/src/agents/tools/web-search-provider-common.ts index 79827ef7cb8..a08ad97915e 100644 --- a/src/agents/tools/web-search-provider-common.ts +++ b/src/agents/tools/web-search-provider-common.ts @@ -100,6 +100,7 @@ export async function postTrustedWebToolsJson( body: Record; errorLabel: string; maxErrorBytes?: number; + extraHeaders?: Record; }, parseResponse: (response: Response) => Promise, ): Promise { @@ -110,6 +111,7 @@ export async function postTrustedWebToolsJson( init: { method: "POST", headers: { + ...params.extraHeaders, Accept: "application/json", Authorization: `Bearer ${params.apiKey}`, "Content-Type": "application/json",