API ReferenceChat

Chat completion

View as Markdown

OpenAI-compatible chat completions, grounded in live web search.

When web_search is false (or tools is false) we skip the SERP fetch entirely and route straight to Claude — sub-1s for simple chat. When stream is true we return Server-Sent Events with OpenAI-style chat.completion.chunk frames terminated by data: [DONE].

Authentication

AuthorizationBearer
Your API key, sent as a Bearer token.

Request

This endpoint expects an object.
messageslist of objectsRequired

OpenAI-style messages (system / user / assistant).

modelstring or nullOptional

Echoed back in the response; does not affect routing.

streambooleanOptionalDefaults to false

When true, return Server-Sent Events with OpenAI-style chat.completion.chunk frames terminated by data: [DONE].

response_formatobject or nullOptional

Output format. text (default), json_object, or json_schema. For json_schema, pass {type:‘json_schema’, json_schema:{name, schema}}.

temperaturedouble or nullOptional0-2

OpenAI-range 0-2. Mapped to Anthropic’s 0-1 range (clamped).

top_pdouble or nullOptional0-1
Nucleus sampling cutoff. Forwarded to Anthropic.
nintegerOptional1-4Defaults to 1
Number of chat completions to generate. Capped at 4.
toolsboolean or list of maps from strings to any or nullOptional

false disables Scout’s built-in web search (pure chat). An array is accepted for OpenAI compatibility but client-defined tools are not yet wired up; Scout’s built-in search is always available.

seedinteger or nullOptional

Deterministic sampling seed (forwarded when supported).

max_tokensintegerOptional1-8192Defaults to 2048
Max tokens in the response.
stopstring or list of strings or nullOptional

String or list of stop sequences. Forwarded as Anthropic stop_sequences.

Response

Successful Response

Errors

422
Unprocessable Entity Error