POST

Authorizations

x-api-key
string
header
required

Headers

Idempotency-Key
string

Replays the first result of a create; the same key with another body is 400 idempotency_key_reused, one while the first still runs 409 idempotency_key_in_use.

Required string length: 1 - 255
bma-workspace-id
string

Project scope. Required when the API key can access more than one project. Also accepted as anthropic-workspace-id; headers sent together must agree, otherwise the request is a 400 workspace_id_conflict.

Body

application/json

A web search. The same schema as the input of the web_search tool (contracts tool.json WebSearchInput).

query
string
required

What to search for, keywords or a question.

Required string length: 1 - 400
num_results
integer

Default 5.

Required range: 1 <= x <= 10
recency
enum<string>

Only results published within this period.

Available options:
day,
week,
month,
year
allowed_domains
string[]

Only results from these domains and their subdomains; not with blocked_domains.

Maximum array length: 20
Minimum string length: 1
blocked_domains
string[]

No results from these domains and their subdomains; not with allowed_domains.

Maximum array length: 20
Minimum string length: 1
locale
string

Language and country to favor (zh-CN, en-US).

Pattern: ^[a-z]{2,3}(-[A-Z]{2})?$

Response

Success.

The answer of one web search.

id
string
required

wsrch_ id of this search.

type
any
required

Always web_search.

created_at
string<date-time>
required

When the search ran.

query
string
required

The query searched, trimmed.

provider
string
required

The search provider that answered (exa, bocha, brave, tavily, exa-keyless; open set).

results
object[]
required

The results, best first, at most num_results.

usage
object
required

What this answer is charged for.

provider_request_id
string

The provider's own request id, when it reports one.