Create an API key1
Revised
Create an API key to call cloud models directly through https://ollama.com/api. A local Ollama installation isn't2 required.
Create a key
- Sign in to Ollama.
- Open API keys.
- 3Create a key.
- Copy the key. You'll4 use it as a bearer token with each request.
Set the key as an environment variable in Bash or Zsh:X43
export OLLAMA_API_KEY="your_api_key"
Keep API keys out of browser code and source control.
Send a request
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": "Say hello in one sentence."
}
],
"stream": false
}'
Read the answer from message.content.5
Next steps
For classification, yes/no questions, and scoring, call System One at https://ollama.com/v1/systemone with the same API key.X29 For examples, see System One cloud examples.6
You can also use OpenAI or Anthropic clients. Each supports a subset of the original API. See OpenAI compatibility and Anthropic compatibility. For endpoint schemas and response fields, see the API Reference.
Notes on this page
1 Wording Audit: improved A task title starts with a verb and names the result.
Was:
Creating an API keytype-title-signals-type2 Wording Audit: improved Uses a contraction as the voice asks.
Was:
is notContractions3 Structure Audit: improved Splits one step that held two actions into two steps.
Was:
3. Create a key and copy it. You will use it as a bearer token with each request.proc-one-action-per-step4 Wording Audit: improved Uses a contraction as the voice asks.
Was:
You will usePronounContractions5 Structure Audit: regression Adds a Next steps heading over the closing paragraphs so the reader sees where to go next; no text was added beyond the heading and a split sentence.
type-task-link-contextAuditor: “Next steps” does not say what the section contains, so it falls short of the standard’s requirement for descriptive headings.
6 Wording Audit: improved Rewords the sentence so the check no longer reads "the System" as a half-named product; the link target is unchanged.
Was:
See the System One cloud examples.ProductName
Questions for the owner
X29 Decision feature also called System One. The capability page, nav and CLI reference call it Decision, while the cloud pages call the same feature System One. Which name should readers see, and should the other be introduced once as an alias?
Pages: Decision, CLI reference, Run cloud models, Create an API key
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
Create an API key to call cloud models directly through https://ollama.com/api. A local Ollama installation is not required.
Create a key
- Sign in to Ollama.
- Open API keys.
- Create a key and copy it. You will use it as a bearer token with each request.
Set the key as an environment variable in Bash or Zsh:
export OLLAMA_API_KEY="your_api_key"
Keep API keys out of browser code and source control.
Send a request
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": "Say hello in one sentence."
}
],
"stream": false
}'
Read the answer from message.content.
For classification, yes/no questions, and scoring, call System One at https://ollama.com/v1/systemone with the same API key. See the System One cloud examples.
You can also use OpenAI or Anthropic clients. Each supports a subset of the original API. For endpoint schemas and response fields, see the API Reference.
What Changed
The title now starts with a verb and names the result. The key-creation step is split so each step has one action, and the follow-on material sits under a Next steps heading with descriptive link text. Two questions from the cross-page review are attached: where API key setup should live, and what name System One should carry.
Content type: task. The page walks a reader who wants an API key through creating it and sending a first request.
Automated check, original: 0 errors, 1 warnings, 2 suggestions. Revised: 0 errors, 0 warnings, 0 suggestions.
Independent audit (GPT-6): mixed. The revision improves the key setup steps and makes the links easier to understand. The new “Next steps” heading is vague, and the marked owner questions are missing from the change log.
Regressions:
- The “Next steps” heading is too generic to help readers scan the section.
What the revision missed:
- The revision marks owner questions X43 and X29, but notes/cloud/api.json lists no questions; the notes summary indicates they concern where API key setup should live and what name System One should carry.
- The final paragraph changes the OpenAI and Anthropic link text from product names to compatibility page names without recording those changes in the change list.
Structure (2)
- 3 Splits one step that held two actions into two steps. improved
- 5 Adds a Next steps heading over the closing paragraphs so the reader sees where to go next; no text was added beyond the heading and a split sentence. regression