Model-grounded web search (Anthropic).
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.
- Тип: integermax
_tokens обязательноMaximum number of tokens to generate in the answer. Required by the upstream Messages API.
- Тип: array object[]messagesобязательно
Conversation messages, same format as the Anthropic Messages API. The user turn holds your question.
- contentТип: string
Message text. Structured content blocks are also accepted.
- roleТип: string enumзначения
- user
- assistant
- Тип: stringsystem
Optional system prompt to steer the answer's tone or format.
- Тип: 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.- Тип: array object[]content
Ordered blocks: server_tool_use (search queries), web_search_tool_result (sources), and text (the cited answer).
Пустой объект - Тип: stringid
- Тип: stringrole
- Тип: stringstop
_reason - Тип: stringtype
- Тип: objectusage
- cacheТип: integer
_creation _input _tokens Integer numbers.
- cacheТип: integer
_read _input _tokens Integer numbers.
- inputТип: integer
_tokens Integer numbers.
- outputТип: integer
_tokens Integer numbers.
- serverТип: object
_tool _use - webТип: 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
}
}
}