Skip to main content
The local API at http://localhost:11434 does not require authentication. To use cloud models, publish models, or download private models, sign in to Ollama. For direct API access to ollama.com, use an API key.

API keys

Direct cloud inference at https://ollama.com/api and https://ollama.com/v1 requires an API key. No Ollama installation or local server is required. Create an API key, then set it in your terminal:
Use the API key in the Authorization: Bearer header. For the hosted Anthropic-compatible Messages API, you can also send the key in the x-api-key header. A valid Authorization credential takes precedence. If the header is missing or empty, or the credential is invalid, Ollama tries x-api-key.
API keys do not expire. Revoke a key in API keys settings. Keep keys outside browser code and source control. See the API quickstart for shell setup and compatibility examples.

Signing in

Sign in from your terminal:
Ollama then authenticates cloud requests for you:
This also works through the local API: