POST /v1/chat/completions

The core routing endpoint.

POST/v1/chat/completionsuser

Route a chat-completion request to the optimal LLM.

Base URL

http
https://app.hiway2llm.com/v1

Request body

Fully OpenAI-compatible. The fields HiWay cares about specifically:

FieldTypeMeaning
modelstring"auto" (smart routing), or a fully-qualified id ("anthropic/claude-haiku-4-5", "openai/gpt-4o", "mistral/mistral-small", …) to pin a model.
messagesarrayStandard chat-completions format, system+user+assistant+tool roles.
streamboolSSE streaming. Works with every supported provider.
toolsarrayOpenAI 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 answered
  • X-HiWay-Routed-Tier - routing tier picked

Response body envelope

See the Response envelope concept page for the full shape of the _hiway metadata object.