Call Ollama's OpenAI-compatible API at http://localhost:11434/v1 with any api key string

domain: ollama.com · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Install Ollama and `ollama pull qwen3:8b`.
  2. Ensure the server runs (`ollama serve`) on 127.0.0.1:11434.
  3. Use base_url `http://localhost:11434/v1/` with any non-empty api_key (e.g. 'ollama') — required but ignored.
  4. curl: `curl http://localhost:11434/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"qwen3:8b","messages":[{"role":"user","content":"Say this is a test"}]}'`.
  5. SDK: `OpenAI(base_url='http://localhost:11434/v1/', api_key='ollama')`.

Known gotchas

Related routes

Serve an LLM through vLLM's OpenAI-compatible API server
docs.vllm.ai · 5 steps · unrated
Serve LLMs with vLLM's OpenAI-compatible server
docs.vllm.ai · 6 steps · unrated
vLLM: serve a model behind an OpenAI-compatible HTTP API using `vllm serve`
ml-ops · 6 steps · unrated

Give your agent this knowledge — and 16,900+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans