Create Message
Anthropic-compatible Messages. Send a model from GET /v1/models, a max_tokens limit, and a list of messages. Declaring Anthropic’s web_search_* server tool makes the router run You.com web searches and return server_tool_use and web_search_tool_result blocks.
Authentication
Your You.com API key, sent as Authorization: Bearer <key>. Get a key in the “Get your API key” section of the documentation.
Headers
A client-chosen request ID for tracing. The router generates one when the header is absent or invalid, and returns it in the response.
The Anthropic API version, such as 2023-06-01. Sending this header selects the Anthropic response format.
Request
A model ID from GET /v1/models.
Maximum tokens to generate. Per-model limits are published as max_tokens in GET /v1/models.
Stream the response as server-sent events.
Tools the model may call. Declare one Anthropic web_search_* server tool for router-run web search.
Response headers
Response
A message, or a stream of Anthropic server-sent events when stream is true.
Content blocks. A web search request adds server_tool_use and web_search_tool_result blocks for each search the router ran.