Get started
Call cloud models with an API key. No Ollama installation required. Start with the API quickstart. To run models on your computer, install Ollama and run a local model.Base URLs
The Anthropic client appends
/v1/messages to its base URL.
Cloud requests need an API key. Local requests do not. To use cloud models through your local server, sign in to Ollama.
Creating or deleting models requires a local Ollama server. For supported API features, see OpenAI compatibility and Anthropic compatibility.
Ollama API example
SetOLLAMA_API_KEY to your API key, then call a cloud model:
message.content. For local inference, use http://localhost:11434/api/chat with a downloaded model and omit the authorization header.
Libraries
Use Ollama’s official libraries with either a local server or the hosted API: For direct cloud access, set the host tohttps://ollama.com and supply your API key in the Authorization: Bearer header.
Browse community libraries.

