ModelsThe model server
Address and rules
- Where:
127.0.0.1:36434, which RoachNet.app always uses. If another program already holds36434(usually anollama servethat an older RoachNet left running), RoachInference listens on a free loopback port instead, andGET /api/system/ai/providersnames it. A runtime you start yourself listens whereverOLLAMA_BASE_URLpoints, as long as it's a loopback address: Ollama's port,11434, or no port means36434. It won't start the model server anywhere else. - Auth: no token, like Ollama. Instead, the
Hostheader must be a loopback name, and anOriginheader must be a loopback,app://,file://,tauri://orvscode-webview://origin. Other websites get a403. - Bodies: may be sent without a JSON content type, as Ollama clients do.
- Errors: OpenAI's shape on the OpenAI routes, Anthropic's on
/v1/messages, Ollama's everywhere else. A missing model is a404before any stream starts.
MODELS=http://127.0.0.1:36434
curl -s "$MODELS/v1/models"Ollama routes
Chat and generate stream newline-delimited JSON unless you send "stream": false. Tool calls come back as objects and are never streamed half-written. format takes "json" or a JSON Schema, which is enforced while the model writes, and think turns a reasoning model's thinking on or off. RoachInference reads text only: since 1.1.3, a request with images gets a 400 that says so.
/api/create makes a new model over an installed one or a local .gguf file, from fields or a Modelfile (FROM, SYSTEM, PARAMETER, MESSAGE). The weights are hard-linked, not copied. /api/tags lists every model the server can load, including models read in place from an Ollama models folder.
OpenAI routes
/v1/chat/completions takes tools, tool_choice, response_format (json_object or json_schema), reasoning_effort and stream_options.include_usage, and streams server-sent events with "stream": true. /v1/responses keeps nothing between calls, so send the history you want each time. Since 1.1.3, an image, audio, video or file part gets a 400, and an embeddings input that is neither text nor a list of texts is refused.
Anthropic routes
/v1/messages takes text, tool_use and tool_result blocks (an image or document block, in a message or a tool result, gets a 400 since 1.1.3), tools, tool_choice and thinking, and streams Anthropic's event stream with "stream": true. /v1/messages/count_tokens counts with the model's own tokenizer and template.
Every route
| Method | Path | What it does |
|---|---|---|
| POST | /api/chat | Chat (Ollama) Ollama’s chat API, streamed as NDJSON unless |
| POST | /api/generate | Generate (Ollama) One prompt in, text out. |
| POST | /api/embed | Embeddings (Ollama) Vectors for one input or a list. |
| POST | /api/create | Make a model A new model over an installed one or a local |
| POST | /api/show | Model details Architecture, parameters, template, capabilities and the Modelfile that makes it. |
| GET | /api/ps | Loaded models What is in memory now. |
| GET | /api/tags | Installed models Every model the server can load, including those in an Ollama models folder, and plan models when they are on. |
| POST | /api/pull | Pull a model Downloads a model from the RoachNet catalog. |
| POST | /api/copy | Copy a model A second name for a model; the weights are linked, not copied. |
| DELETE | /api/delete | Delete a model Unloads it and removes it from the store. |
| POST | /v1/chat/completions | Chat completions (OpenAI) OpenAI’s chat API, streamed as server-sent events when |
| POST | /v1/completions | Completions (OpenAI) Plain text completion of a prompt. |
| POST | /v1/responses | Responses (OpenAI) OpenAI’s Responses API, with function tools and structured output. |
| POST | /v1/embeddings | Embeddings (OpenAI) OpenAI’s embeddings shape. |
| GET | /v1/models | Models (OpenAI) The installed models in OpenAI’s list shape; |
| POST | /v1/messages | Messages (Anthropic) Anthropic’s Messages API, streamed as its event stream when |
| POST | /v1/messages/count_tokens | Count tokens (Anthropic) How many tokens a Messages request would send. |
17 routes, from the route data the route browser uses, checked against Router.swift at tag v1.1.4.
Related
- Use RoachNet with Ollama, OpenAI and Anthropic clients has examples for each format.
- RoachClaw covers which models load and how memory is planned.