Skip to article

Tavily

Basic normalized retrieval with snippets and reported credits; richer native search and extraction remain explicit.

On this page

Normalized search

Normalized search selects basic depth, disables generated answers and raw content, requests usage, and uses restrictive native domain inclusion. Native content becomes a snippet; score, request ID, and credits retain their provider meaning.

tavily-search.ts · server
import { createSearch } from '@belweave/search-sdk';
import { tavily } from '@belweave/search-sdk/tavily';

const apiKey = process.env.TAVILY_API_KEY;
if (!apiKey) throw new Error('TAVILY_API_KEY is required');

const client = createSearch({ provider: tavily({ apiKey }) });
const response = await client.web.search({
  query: 'SQLite write concurrency',
  limit: 5,
});
console.log(response.results, response.attempts);

Native search depth and automatic parameter selection can change work and cost. Keep them explicit on the native client. An API account-limit failure is terminal authentication/account authorization, rather than an automatic fallback opportunity.

300 include / 150 exclude.

Provider-native client

tavily-native.ts · server
import { createTavilyClient } from '@belweave/search-sdk/native-tavily';

const apiKey = process.env.TAVILY_API_KEY;
if (!apiKey) throw new Error('TAVILY_API_KEY is required');

const client = createTavilyClient({ apiKey, timeoutMs: 10_000 });
const response = await client.search({ body: { query: 'SQLite write concurrency', search_depth: 'basic', max_results: 5 } });
console.log(response.data, response.metadata);

Read provider data from response.data and sanitized transport details from response.metadata. Native TypeScript response types are not runtime schema validation. Preserve the operation's native response and source identities.

Native operation inventory

Methods available on this native client. Paths are relative to each operation's fixed base; a provider may use more than one origin. Eligible operations retry only when you opt into a client retry policy.

16 / 16
MethodHTTP / relative pathResponse / retry eligibility
getPaymentPricingGET /.well-known/pricingraw · eligible
paidSearchPOST /searchjson · no automatic retry
crawlPOST /crawljson · no automatic retry
deactivateKeysPOST /deactivate-keysjson · no automatic retry
extractPOST /extractjson · no automatic retry
feedbackPOST /feedbackjson · no automatic retry
generateKeysPOST /generate-keysjson · no automatic retry
keyInfoGET /key-infojson · eligible
logsPOST /logsjson · no automatic retry
mapPOST /mapjson · no automatic retry
orgUsagePOST /org-usagejson · no automatic retry
getResearchGET /research/{request_id}json · eligible
researchPOST /researchjson · no automatic retry
researchStreamPOST /researchSSE stream · no automatic retry
searchPOST /searchjson · no automatic retry
getUsageGET /usagejson · eligible

Limits and operation lifecycle

  • Pass signal and per-call timeoutMs on native request input when needed.
  • Persist a returned job identifier before explicitly reading or polling the same job. Native clients do not automatically poll.
  • SSE data is incremental provider event text. Parse and validate terminal or error events according to the provider contract; there is no reconnect or replay.
  • Native operations may create, delete, ingest, or incur charges. A successful HTTP response is not proof that a remote job completed.

Official sources

Use the official reference for current schemas, account access, and operation-specific requirements.