# What is temperature in an LLM?

> Temperature controls how random a model's output is. OpenAI accepts 0 to 2, and newer Claude and Gemini models ignore or reject custom values.

Canonical: https://promptlyfound.com/glossary/temperature
Updated: 2026-11-20

## Short answer

Temperature is **a setting that controls how random a language model's output is**. Lower values make the model pick the most likely tokens more often, so the text is more predictable, and higher values give more varied text. Anthropic says results are not fully deterministic even at 0, and newer Claude and Gemini models ignore or reject custom values.

## Key findings

- OpenAI's API accepts a temperature between 0 and 2, with a default of 1. OpenAI says values like 0.8 make output more random and values like 0.2 make it more focused and deterministic. [1]
- Anthropic says that even with temperature set to 0, results are not fully deterministic, and identical inputs can produce different outputs across API calls. [2]
- Anthropic's API reference says models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 is accepted, and other values are rejected with an error. [3]
- The Gemini API accepts temperature values from 0.0 to 2.0, and silently ignores the field on Gemini 3.6 Flash and newer models. [4]

Temperature sets how random a language model's output is, which is one reason the same prompt can get different answers. AI search products do not say what sampling settings they use, so one run of a prompt is a single sample of what a brand might get.

A model writes one token at a time. At each step, it gives every possible next token a probability, and a sampler picks one. The temperature changes how strongly the sampler favors the most likely tokens.

## How temperature works

[Google Cloud's page on content generation parameters](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/content-generation-parameters) says a temperature of 0 means the highest-probability tokens are always selected. Responses are then mostly deterministic, though a small amount of variation is still possible. Lower temperatures suit prompts that need a less open-ended answer, and higher temperatures can give more diverse or creative results.[5]

The range differs by provider. [OpenAI's API reference](https://developers.openai.com/api/reference/resources/responses/methods/create) accepts values between 0 and 2, with a default of 1. It says higher values like 0.8 make output more random, and lower values like 0.2 make it more focused and deterministic. OpenAI recommends changing temperature or top_p, but not both.[1] [Anthropic's API reference](https://platform.claude.com/docs/en/api/completions/create) gives a range of 0.0 to 1.0, with a default of 1.0.[3]

## Temperature and repeatable output

A low temperature does not guarantee the same answer twice. [Anthropic's glossary](https://platform.claude.com/docs/en/about-claude/glossary) says that even with temperature set to 0, results are not fully deterministic, and identical inputs can produce different outputs across API calls.[2] [OpenAI's Chat Completions reference](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create) offers a seed parameter that makes a best effort to sample deterministically, and says determinism is not guaranteed.[6]

## Newer models

Providers have started to remove the setting. Anthropic's API reference says models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 is accepted, and other values are rejected with an error.[3] [Google's Gemini API reference](https://ai.google.dev/api/generate-content) says the temperature field is silently ignored on Gemini 3.6 Flash and newer models.[4] OpenAI says parameter support differs by model, particularly for newer reasoning models.[6] [What are reasoning models?](https://promptlyfound.com/llms/reasoning-models) covers how those models work.

## Temperature and AI search

The references above describe developer APIs. They do not say what sampling settings ChatGPT search, Gemini or Google's AI features use, so a site owner cannot tell how much of the variation in AI answers comes from sampling.

AI answers do vary between runs. Promptly Found's study of [how much AI answers change from one day to the next](https://promptlyfound.com/research/ai-answer-stability) measured how often the brands named for the same question changed. The study treats each answer as one sample from a wide spread and recommends running a prompt many times before reading a result. [How to test AI search visibility with prompts](https://promptlyfound.com/measurement/ai-visibility-prompts) covers how to set up such a test. [How do large language models work?](https://promptlyfound.com/llms/how-llms-work) explains token prediction in more detail.

## Sources

1. Create a model response. OpenAI API reference. https://developers.openai.com/api/reference/resources/responses/methods/create
2. Glossary. Claude API documentation. https://platform.claude.com/docs/en/about-claude/glossary
3. Create a Text Completion. Claude API reference. https://platform.claude.com/docs/en/api/completions/create
4. Generating content. Gemini API reference. https://ai.google.dev/api/generate-content
5. Content generation parameters. Google Cloud documentation. https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/content-generation-parameters
6. Create chat completion. OpenAI API reference. https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create

---

This is a plain-text copy of https://promptlyfound.com/glossary/temperature from Promptly Found. The web page is the canonical version and includes the charts.
