ModelsThe model server

RoachInference answers the Ollama, OpenAI and Anthropic APIs on one loopback port, streamed or not, with each API's own error shape.

macOS 1.1.4127.0.0.1:364343 min read
On this page

Address and rules

  • Where: 127.0.0.1:36434, which RoachNet.app always uses. If another program already holds 36434 (usually an ollama serve that an older RoachNet left running), RoachInference listens on a free loopback port instead, and GET /api/system/ai/providers names it. A runtime you start yourself listens wherever OLLAMA_BASE_URL points, as long as it's a loopback address: Ollama's port, 11434, or no port means 36434. It won't start the model server anywhere else.
  • Auth: no token, like Ollama. Instead, the Host header must be a loopback name, and an Origin header must be a loopback, app://, file://, tauri:// or vscode-webview:// origin. Other websites get a 403.
  • 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 a 404 before any stream starts.
Terminal
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

MethodPathWhat it does
POST/api/chatChat (Ollama)

Ollama’s chat API, streamed as NDJSON unless stream: false.

POST/api/generateGenerate (Ollama)

One prompt in, text out. raw: true skips the chat template; an empty prompt only loads the model.

POST/api/embedEmbeddings (Ollama)

Vectors for one input or a list.

POST/api/createMake a model

A new model over an installed one or a local .gguf, with its own system prompt, parameters and messages.

POST/api/showModel details

Architecture, parameters, template, capabilities and the Modelfile that makes it.

GET/api/psLoaded models

What is in memory now.

GET/api/tagsInstalled models

Every model the server can load, including those in an Ollama models folder, and plan models when they are on.

POST/api/pullPull a model

Downloads a model from the RoachNet catalog.

POST/api/copyCopy a model

A second name for a model; the weights are linked, not copied.

DELETE/api/deleteDelete a model

Unloads it and removes it from the store.

POST/v1/chat/completionsChat completions (OpenAI)

OpenAI’s chat API, streamed as server-sent events when stream: true.

POST/v1/completionsCompletions (OpenAI)

Plain text completion of a prompt.

POST/v1/responsesResponses (OpenAI)

OpenAI’s Responses API, with function tools and structured output.

POST/v1/embeddingsEmbeddings (OpenAI)

OpenAI’s embeddings shape.

GET/v1/modelsModels (OpenAI)

The installed models in OpenAI’s list shape; /v1/models/:id answers one.

POST/v1/messagesMessages (Anthropic)

Anthropic’s Messages API, streamed as its event stream when stream: true.

POST/v1/messages/count_tokensCount 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.

Checked against v1.1.4 · 5 November 2026
esc
↑ ↓ move↵ openesc closeSearches on your device. Nothing is sent anywhere.