mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-06 08:06:50 +00:00
Tavily's /search endpoint documents a single credential scheme, `Authorization: Bearer <key>`, and its official Python/JS SDKs send only that header. The provider still put the key in an `api_key` body field and sent no Authorization header, so web search emulation through Tavily relied on an undocumented contract. Brave and Exa in the same package already send their keys as headers. Send the key as a Bearer token and drop it from the request body. The old unit test only marshalled the request struct and asserted the body `api_key`, so it locked in the stale contract without exercising Search(); replace it with a test that drives Search() through a recording transport and checks the outgoing headers and body. Refs #7201