Felo API PlatformFelo API Platform

数据 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.