Skip to content

Ollama Docs, Revised

Authentication

Task page. 5 changes, 3 questions for the owner. Audit: mixed. Original source at commit 318ee28.

Revised

The local API at http://localhost:11434 doesn't1 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.?1

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:X43

export OLLAMA_API_KEY="your_api_key"

Use the API key in the Authorization: Bearer header. This also applies to the hosted Anthropic-compatible /v1/messages endpoint. x-api-key alone isn't supported.2

curl https://ollama.com/api/chat \
  -H "Authorization: Bearer $OLLAMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma4:31b",
    "messages": [{"role": "user", "content": "Why is the sky blue?"}],
    "stream": false
  }'

API keys don't3 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:4

ollama signin

Ollama then authenticates cloud requests for you:5X3

ollama run gpt-oss:120b-cloud

This also works through the local API:

curl http://localhost:11434/api/generate -d '{
  "model": "gpt-oss:120b-cloud",
  "prompt": "Why is the sky blue?"
}'

Notes on this page

  1. 1 Wording Audit: improved Uses a contraction as the voice asks.

    Was: does not

    Contractions

    Auditor: “Doesn’t” is more conversational and preserves the original meaning.

  2. 2 Wording Audit: improved Splits the sentence at the semicolon and uses a contraction; the meaning is unchanged.

    Was: endpoint; x-api-key alone is not supported.

    Semicolon Contractions

    Auditor: Splitting the semicolon sentence makes the two points easier to read while preserving their meaning.

  3. 3 Wording Audit: improved Uses a contraction as the voice asks.

    Was: do not

    Contractions

    Auditor: “Don’t” is more conversational and preserves the original meaning.

  4. 4 Structure Audit: regression The fence had no language label; it now says shell. The code is unchanged.

    Was: ollama signin

    code-block-language

    Auditor: The shell label changes a code fence despite the instruction not to edit code blocks, and the supplied standard does not require language labels.

  5. 5 Structure Audit: regression The fence had no language label; it now says shell. The code is unchanged.

    Was: ollama run gpt-oss:120b-cloud

    code-block-language

    Auditor: The shell label changes a code fence despite the instruction not to edit code blocks, and the supplied standard does not require language labels.

Questions for the owner

  • ?1 This page covers two goals, using an API key for direct access and signing in to a local server; should the standard's one-goal-per-task rule split them, or does the page stay as one?

    About: “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.”

  • X3 Cloud model name form for a signed-in local server. Cloud models says local tools use a :cloud name, but other pages use a -cloud suffix, or the bare hosted name after ollama signin. Is the -cloud suffix still valid alongside :cloud, and which form should every page use for cloud models reached through a local server?

    Pages: Run cloud models, Authentication, Run Codex CLI with Ollama, Run Droid with Ollama, Use Ollama in marimo

  • X43 API key setup repeated on five pages. Creating the key and exporting OLLAMA_API_KEY is repeated in Quickstart, Creating an API key, Authentication and both compatibility pages; only Quickstart gives the PowerShell form. Which page should own API key setup, with the others linking to it?

    Pages: Quickstart, Create an API key, Authentication, OpenAI compatibility, Anthropic compatibility

Original

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:

export OLLAMA_API_KEY="your_api_key"

Use the API key in the Authorization: Bearer header. This also applies to the hosted Anthropic-compatible /v1/messages endpoint; x-api-key alone is not supported.

curl https://ollama.com/api/chat \
  -H "Authorization: Bearer $OLLAMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma4:31b",
    "messages": [{"role": "user", "content": "Why is the sky blue?"}],
    "stream": false
  }'

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 signin

Ollama then authenticates cloud requests for you:

ollama run gpt-oss:120b-cloud

This also works through the local API:

curl http://localhost:11434/api/generate -d '{
  "model": "gpt-oss:120b-cloud",
  "prompt": "Why is the sky blue?"
}'

What Changed

Contractions follow the voice, one semicolon becomes two sentences, and two code fences that had no language now say shell. Two questions are attached: the page holds two goals under one title, and the cloud model name form conflicts with another page.

Content type: task. The page tells a reader how to authenticate, either with an API key or by signing in, with steps and examples for each.

Automated check, original: 0 errors, 0 warnings, 4 suggestions. Revised: 0 errors, 0 warnings, 0 suggestions.

Independent audit (GPT-6): mixed. The wording edits make the page a little easier to read without changing its meaning. The two code-fence edits break the instruction to leave code blocks unchanged, and the standard’s step-formatting guidance is still unmet.

Regressions:

  • The revision changes the language labels on two code blocks despite the instruction to leave code blocks unchanged.

What the revision missed:

  • The page gives procedural instructions in prose rather than numbered steps, though the standard says to number steps with one action each.
  • The “API keys” and “Signing in” headings identify topics but could say what the reader can do, as the standard requires headings to describe what is under them.
  • The revision marks a question with ⟦X3⟧ after the cloud request example, but the notes list no corresponding question for the documentation owner.

Structure (2)

  • 4 The fence had no language label; it now says shell. The code is unchanged. regression
  • 5 The fence had no language label; it now says shell. The code is unchanged. regression

Wording (3)

  • 1 Uses a contraction as the voice asks. improved
  • 2 Splits the sentence at the semicolon and uses a contraction; the meaning is unchanged. improved
  • 3 Uses a contraction as the voice asks. improved