Expand description
Chat Completions (POST {base}/chat/completions), the format OpenAI,
Azure OpenAI (v1), Mistral, OpenRouter, Groq, Ollama, vLLM and LM Studio
speak. Stateless like the Messages API, so the loop stays the same.
Rules (design page):
strict,tool_choiceandparallel_tool_callsare never sent.- Tool arguments are a JSON string that may be invalid: a call whose arguments do not parse as an object gets a tool error, the run goes on.
- A missing call id is made up (9 alphanumeric characters – Mistral rejects longer ids); an id from the server is sent back unchanged.
- Tool calls win over
finish_reason(some servers saystop). - There is no error flag on a tool message: a failed result starts with
Error:. - Without
usagein the reply,Usage::reportedis false.
Structs§
- OpenAi
- The Chat Completions wire format.
Enums§
- Flavour
- Which flavour of Chat Completions.