Anthropic Web Search
Generate cited answers using web search.
Model-grounded web search (Anthropic).
Generate a cited answer with Claude and web search. Supply messages and max_tokens. The model and web_search tool are managed by the service; max_uses bounds the number of searches. The response is an Anthropic Messages object with tool-use, search-result and text blocks. usage reports resource consumption, not a Felo charge.
- Type: integermax
_tokens requiredMaximum number of tokens to generate in the answer. Required by the upstream Messages API.
- Type: array object[]messagesrequired
Conversation messages, same format as the Anthropic Messages API. The user turn holds your question.
- contentType: string
Message text. Structured content blocks are also accepted.
- roleType: string enumvalues
- user
- assistant
- Type: stringsystem
Optional system prompt to steer the answer's tone or format.
- Type: object200
A standard Anthropic Messages response.
content[]interleaves the searches performed and the cited answer;usage.server_tool_use.web_search_requestsis the billed search count.- Type: array object[]content
Ordered blocks: server_tool_use (search queries), web_search_tool_result (sources), and text (the cited answer).
Empty object - Type: stringid
- Type: stringrole
- Type: stringstop
_reason - Type: stringtype
- Type: objectusage
- cacheType: integer
_creation _input _tokens Integer numbers.
- cacheType: integer
_read _input _tokens Integer numbers.
- inputType: integer
_tokens Integer numbers.
- outputType: integer
_tokens Integer numbers.
- serverType: object
_tool _use - webType: integer
_search _requests Billed web search count.
application/json - 400
The request could not be processed. Check the request parameters.
- 401
A valid Felo API key is required.
- 402
The request cannot proceed because a billing requirement is not met.
- 403
The account is not permitted to perform this operation.
- 429
A request or spending limit has been reached.
- 502
The service could not complete the request.
- 503
The API or billing service is temporarily unavailable.
- 504
The service timed out while processing the request.
- default
The operation failed. Keep the response request ID when contacting Felo support.
curl https://openapi.felo.ai/v1/beta/anthropic-websearch/search \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "What are the three biggest AI announcements this week? Give one sentence each with sources."
}
]
}'
{
"id": "string",
"type": "message",
"role": "assistant",
"stop_reason": "end_turn",
"content": [
{}
],
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"cache_read_input_tokens": 1,
"cache_creation_input_tokens": 1,
"server_tool_use": {
"web_search_requests": 1
}
}
}