
If a local AI client requests the wrong route, or tries to read a native response as an OpenAI-compatible response, changing the prompt will not resolve the mismatch. Check the final URL and the response reader together.
Kingy test scope: On September 6, 2026, we reproduced a route mismatch and response-shape failure against a synthetic loopback server using Python 3.14.0 on macOS. We verified both corrected route/reader pairs. No Ollama daemon, OpenAI SDK, Docker network, or model inference was tested. Our fixture’s 404 wording is synthetic, not a captured Ollama error.
Choose one interface
| Interface | HTTP endpoint | Non-streaming text field |
|---|---|---|
| Ollama native chat | POST /api/chat |
message.content |
| OpenAI-compatible chat | POST /v1/chat/completions |
choices[0].message.content |
Ollama documents native chat separately from its partial OpenAI API compatibility. For an OpenAI client, its documented base URL includes /v1/; the SDK supplies the operation path. Native chat reference · Compatibility reference
With a direct HTTP client, supply the full endpoint. For these examples, stream: false keeps streaming format differences out of the initial diagnosis. Use the exact model name installed on your own server.
What we reproduced
- A request to the synthetic route
/api/chat/completionsreturned 404. The fixture recognized/api/chatand/v1/chat/completionsinstead. - Reading the native fixture response with
body["choices"][0]["message"]["content"]raisedKeyError: 'choices'. - Native route plus
body["message"]["content"]returnedNative shape. - Compatible route plus
body["choices"][0]["message"]["content"]returnedCompatible shape.
The point of this experiment is to make both client mistakes reproducible, without attributing an invented server regression to Ollama.
Apply the fix
Log only the final endpoint path and the top-level response keys in a disposable diagnostic run. Keep prompts and credentials out of shared logs. Confirm whether the application expects a native provider URL or an OpenAI-compatible base URL, then pair its configured interface with its reader.
A native provider field may expect only the server origin. Do not automatically append /v1 to every “Ollama URL” field. Conversely, an OpenAI SDK base URL and a raw HTTP endpoint are different configuration values.
Download the self-contained lab, then run:
python3 ollama_client_lab.py
The endpoint-mismatch result must pass. Recorded results
When this does not fix it
A 404 can indicate an unavailable model or another routing problem; it does not prove an API-family mismatch. Connection refusal happens before an HTTP response and needs a separate network diagnosis. Reverse proxies may add path prefixes. Streaming readers also differ, so do not apply the table’s non-streaming extraction to a raw stream.
Next: Fix Extra data or reject incomplete streamed answers. For Kingy’s broader local setup context, see the OpenClaw and UGREEN companion.
Keep the test in context
These are client-protocol examples. For hardware fit estimates, use Local Lab; for the related setup walkthrough, read Kingy’s OpenClaw and UGREEN guide.