Ollama · REST API

Use the OpenAI-compatible endpoint

Call the chat completions endpoint so tools built for the OpenAI API work with Ollama.

curl http://localhost:11434/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "Hello"}]}'

Official Ollama documentation

More rest api commands

All rest api commands · Ollama cheatsheet

Was this page helpful?