Create Chat Completion
OpenAI-compatible Chat Completions. Send a model from GET /v1/models and a list of messages. Add a web_search or web_extract tool to let the router run You.com web searches and page fetches for the model. Parameters are forwarded to the model, and models differ in what they accept.
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.
Request
A model ID from GET /v1/models.
Stream the response as server-sent events.
Options for streamed responses, such as include_usage.
Maximum tokens to generate. Per-model limits are published as max_tokens in GET /v1/models.
A seed for best-effort deterministic sampling.
Output format, such as {"type": "json_object"} or a json_schema definition.
Tools the model may call. Use function tools that your code executes, or the You.com web tools described below.
Controls which tool the model calls: none, auto, required, or an object naming a function.
Allow the model to call several tools in one turn. Defaults to true when a web tool is declared.
Key-value pairs attached to the request.
Response headers
Response
A chat completion, or a stream of chat.completion.chunk server-sent events when stream is true.
Token counts, the same in streamed and non-streamed responses. The object has no cost fields.