Integration guide

Local Runtime IntegrationsOpen sourceUpdated 2026

Ollama API Integration

Local API surface for connecting open-weight models to apps, scripts, chat UIs, automations, and developer tools.

BeginnerSetup
SupportedLocal runtime
3Related paths

Recommended path

Ollama API local AI quick start

  1. 1. Install Ollama, pull a model, and verify itStart Ollama, pull the required chat or embedding model, and make one direct request before connecting another application. The local server normally listens on port 11434.
  2. 2. Choose the native or compatible API deliberatelyUse /api/chat or /api/embed for Ollama-native features. Use the /v1 base URL only when an existing OpenAI client is the simpler integration path.
  3. 3. Test the exact endpoint and payload you will shipVerify streaming, tools, images, structured output, or embeddings with the selected model. OpenAI compatibility is broad but not a promise that every client parameter is identical.

Best for

Developers who want a simple local model endpoint behind apps and workflows.

Model support

Ollama exposes its own REST API at /api, including /api/generate, /api/chat, /api/embed, /api/tags, /api/pull and /api/ps, plus an OpenAI-compatible layer at /v1 covering chat completions, completions, models, embeddings and responses.

Choose models by role

Chat, generation, and tools

Mistral Small 3.1

Use a chat model that supports the features your client requests, especially tools, vision, or structured output. Pulling a model does not imply that every feature is available.

Open the model profile →

Embeddings

Qwen3 Embedding

Use a dedicated embedding model through /api/embed or /v1/embeddings. Keep its dimension and preprocessing stable across indexing and queries.

Open the model profile →

How to use this integration

  • Point an existing OpenAI client at a local server by changing one base URL
  • Generate embeddings locally for a private search or RAG index
  • Check what is loaded and how much memory it is using through /api/ps before scheduling work
  • Swap models behind a stable local endpoint without touching application code

Connecting a local model

The server listens on http://localhost:11434, and OpenAI-compatible clients point at http://localhost:11434/v1 by changing only the base URL. Models must be pulled before first use.

Tradeoffs

OpenAI compatibility is substantial but not identical. The Responses API does not support stateful conversation management through previous_response_id or the conversation field, and image generation is still documented as experimental. Test the exact client and endpoint instead of relying on an old unsupported-parameter list; capabilities continue to expand. Separately, keep_alive defaults to five minutes, so the first request after an idle period can pay the model-load cost.

Source

Ollama API docs