ClientsOllama, OpenAI and Anthropic
On this page
What you need
- RoachNet 1.1 running, with at least one model installed. List them with
/v1/modelsor/api/tags. - A client on the same Mac. The server listens on loopback only and takes no token, like Ollama.
MODELS=http://127.0.0.1:36434
curl -s "$MODELS/api/tags"The examples below use qwen2.5-coder:7b; use a name from that list.
Ollama format
curl -s "$MODELS/api/chat" -d '{
"model": "qwen2.5-coder:7b",
"messages": [{"role": "user", "content": "Three facts about Apple Silicon."}],
"stream": false
}'Ollama clients usually read the address from OLLAMA_HOST. Set it to 127.0.0.1:36434, or enter http://127.0.0.1:36434 wherever the tool asks for an Ollama URL.
OpenAI format
curl -s "$MODELS/v1/chat/completions" \
-H "content-type: application/json" \
-d '{"model": "qwen2.5-coder:7b", "messages": [{"role": "user", "content": "Three facts about Apple Silicon."}]}'In an OpenAI client, set the base URL to http://127.0.0.1:36434/v1. The server doesn't check API keys, so any placeholder works where a client insists on one. /v1/responses, /v1/completions, /v1/embeddings and /v1/models answer too.
Anthropic format
curl -s "$MODELS/v1/messages" \
-H "content-type: application/json" \
-d '{"model": "qwen2.5-coder:7b", "max_tokens": 256, "messages": [{"role": "user", "content": "Three facts about Apple Silicon."}]}'In an Anthropic client, set the base URL to http://127.0.0.1:36434. /v1/messages/count_tokens counts with the model's own tokenizer.
Tools, structured output and thinking
- Tool calls come back in each API's own shape, and a stream never shows half a call as text. Forcing a tool (
tool_choiceset torequiredor a named tool, or Anthropic'sanyortool) holds the reply to that tool's parameters. - Structured output is enforced while the model writes. Send
format(Ollama) orresponse_formatwithjson_schema(OpenAI), and the reply is valid JSON that matches the schema. - Thinking can be turned off for models that reason first:
think: false(Ollama),reasoning_effort: "none"(OpenAI) or a disabledthinkingblock (Anthropic). - Made models.
/api/createmakes a new model from an installed one or a local.gguf, with its own system prompt and parameters. The weights are linked, not copied.
Plan models
When Claude or ChatGPT plans are turned on, claude:… and codex:… models are listed by /api/tags and /v1/models and answer on these APIs too. Those replies come from your own Claude Code or Codex CLI, not from your Mac's GPU. See Plans as models.
Limits
- Only clients on the same Mac. A web page in a browser is refused unless its origin is loopback or an app scheme (
app://,file://,tauri://,vscode-webview://). - Text only. A request that carries pictures, audio, video or files gets a
400that says so: Ollamaimages, OpenAI image, audio, video and file parts, and Anthropic image and document blocks. Before 1.1.3 they were dropped without a word. - The model must be one RoachInference reads: Llama, Mistral, Qwen2 or Qwen3.
Related
- Model server reference lists all 17 routes.
- RoachClaw and local models covers memory and parallel requests.