POST /v1/chat/completions
The core routing endpoint.
POST
/v1/chat/completionsuserRoute a chat-completion request to the optimal LLM.
Base URL
http
https://app.hiway2llm.com/v1Request body
Fully OpenAI-compatible. The fields HiWay cares about specifically:
| Field | Type | Meaning |
|---|---|---|
model | string | "auto" (smart routing), or a fully-qualified id ("anthropic/claude-haiku-4-5", "openai/gpt-4o", "mistral/mistral-small", …) to pin a model. |
messages | array | Standard chat-completions format, system+user+assistant+tool roles. |
stream | bool | SSE streaming. Works with every supported provider. |
tools | array | OpenAI tool-use format. Forwarded as-is to compatible providers. |
temperature, top_p, seed, response_format, max_tokens… | - | All forwarded unchanged. |
Response headers
X-HiWay-Routed-Model- fully-qualified model id that actually answeredX-HiWay-Routed-Tier- routing tier picked
Response body envelope
See the Response envelope concept page for the full shape of the _hiway metadata object.