API – explained simply
An API is a defined interface through which one program gives another instructions, for example a chat interface to a local language model.
Also: Interface, Programming interface, OpenAI-compatible, REST API
Like an order form, an API defines what a request must look like and what comes back. Many local AI programs work this way: a server program hosts the model, and interfaces or scripts send it requests.
Ollama provides its API locally at http://localhost:11434/api, for example, plus an OpenAI-compatible variant at http://localhost:11434/v1. OpenAI-compatible means: programs that were actually built for OpenAI's cloud can often be switched to your local model with little effort. Local requests with Ollama do not need an API key.
What does that mean for you? If a program asks for an API address, you usually enter http://localhost:11434 for Ollama.
Related terms
Errors where that matters
- Hugging Face: Cannot access gated repo (401)
- llama-server: the request exceeds the available context size, try increasing it (request longer than the context length)
- LM Studio: Trying to keep the first … tokens when context the overflows (Input is longer than the configured context length)
- MCP error -32000: Connection closed (MCP server does not start or quits immediately)
- Model forgets the beginning or ignores long texts (context length too small)
- Ollama: model "…" not found, try pulling it first (model missing on this server)
- Ollama: Port 11434 already in use (bind: address already in use)
- Ollama: registry.ollama.ai/library/… does not support tools (model cannot do tool/function calling)
- Open WebUI or AnythingLLM can't find Ollama