- GUI (Windows and macOS) — a simple chat window similar to ChatGPT, Claude, or Gemini.
- CLI — a terminal-based chat interface for quick interactions and scripting.
- REST API — a programmatic HTTP interface for building applications that generate text or conduct multi-turn chats.

Ollama exposes a local REST endpoint at
http://localhost:11434. Make sure the Ollama server is running before making API requests.1) Ensure the Ollama server is running
Start (or check) the server from your terminal:2) Test the REST API with curl (streaming)
Ollama’s generate endpoint ishttp://localhost:11434/api/generate. By default the API streams partial tokens as newline-delimited JSON events. This is ideal for low-latency UIs that render tokens as they arrive.
Example curl request (default behavior: streaming):
Streaming is useful for low-latency UIs. If you prefer a single complete result (for easier parsing or logging), disable streaming in the request body by setting
"stream": false.3) Receive the full response in a single JSON object (non-streaming)
To get one complete response instead of token-by-token events, include"stream": false in the request body.
Request body (example for curl or Postman):
4) Using Postman (or other HTTP clients)
You can replicate the same POST request from Postman, Insomnia, or any HTTP client:- Method: POST
- URL:
http://localhost:11434/api/generate - Body: raw JSON (example below)
Why this matters
Using the Ollama REST API lets you integrate locally hosted LLMs into web servers, desktop apps, and backend services using any language that can make HTTP requests (Python, JavaScript, C#, Java, etc.). Running models locally improves privacy, reduces latency, and allows offline capabilities where appropriate. If you’re new to this, try the following next steps:- Experiment with both streaming and non-streaming modes to see which fits your UI/UX.
- Build a simple backend client in your preferred language to handle token streaming.
- Use
ollama listto manage and choose models for different tasks (summarization, code generation, chat).
Links and References
- Ollama documentation
- Kubernetes Basics (general reference for deploying services)
- Curl manual