資料 API / Anthropic Web Search / 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.
參數
沒有路徑、查詢或請求標頭參數。
請求主體
messagesobject[]必填Conversation messages, same format as the Anthropic Messages API. The user turn holds your question.
rolestring選填允許值: user · assistant
contentstring選填Message text. Structured content blocks are also accepted.
max_tokensinteger必填Maximum number of tokens to generate in the answer. Required by the upstream Messages API.
systemstring選填Optional system prompt to steer the answer's tone or format.
請求範例
curl -X POST "https://openapi.felo.ai/v1/beta/anthropic-websearch/search" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{}
],
"max_tokens": 0,
"system": "<string>"
}'回應
回應欄位
idstring選填typestring選填rolestring選填stop_reasonstring選填contentobject[]選填Ordered blocks: server_tool_use (search queries), web_search_tool_result (sources), and text (the cited answer).
usageobject選填input_tokensinteger選填output_tokensinteger選填cache_read_input_tokensinteger選填cache_creation_input_tokensinteger選填server_tool_useobject選填web_search_requestsinteger選填Billed web search count.