# Temperature

> Temperature sets how random a model

Canonical: https://scaplet.com/glossary/temperature

Glossary Glossary · AI search

Temperature sets how random a model's token choice is. What Google documents, why Claude Sonnet 5.5 returns an error if you send it, and how to check your code.

2 min

read

2

sources

Oct 28, 2026

updated

Scaplet Editorial Team

author

In one line

Temperature is a sampling setting that controls how random a language model's token selection is. Google's docs say lower values suit prompts that need more deterministic answers, higher values suit more varied output, and a temperature of 0 always picks the highest-probability response. Some newer models no longer accept it.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Ftemperature%20(%22Temperature%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Ftemperature%20(%22Temperature%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Ftemperature%20(%22Temperature%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Ftemperature%20(%22Temperature%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

Randomness of token selection

Controls

top_p, top_k

Related settings

Sending it returns a 400 error

Claude Sonnet 5.5

Ignored, with deprecation warning headers

Gemini 4 and 3.6+

_01_At a glance

## What the setting changes

Google's [prompting](/glossary/prompt-engineering) guide ties low values to more deterministic answers and high values to more varied or creative ones. It describes topK of 1 as greedy decoding, where the single most probable token is always picked, and topP as selecting [tokens](/glossary/tokenization) from most to least probable until their probabilities add up to the topP value.

Setting

### Temperature 0

Direction

Lowest

Documented effect

Highest-probability response is always selected

Setting

### Lower temperature

Direction

Down

Documented effect

More deterministic output

Setting

### Higher temperature

Direction

Up

Documented effect

More varied or creative output

Setting

### topK 1

Direction

Narrowest

Documented effect

Greedy decoding, one most probable token

Setting

### topP

Direction

Probability mass

Documented effect

Tokens taken most to least probable until the sum reaches topP

These are model-level choices, so they sit beside the prompt, not inside it. For consistent formats, [structured outputs](/glossary/structured-outputs) constrain the shape of a reply directly.

_02_At a glance

## Anatomy: the parameter that now causes a 400

Model family

### [Claude](/ai-search/anthropic/ads) Sonnet 5.5

What happens to sampling parameters

`temperature`, `top_p` and `top_k` return a 400 error. Remove them.

Source

Anthropic migration guide

Model family

### [Gemini](/ai-search/gemini) 4 and Gemini 3.6+

What happens to sampling parameters

Custom values are ignored and deprecation warning headers return. Google says 400 errors will follow in a future release.

Source

Google prompting guide

Model family

### Earlier Gemini 3 models

What happens to sampling parameters

Keep the parameters at their default values.

Source

Google prompting guide

A request that worked on older models and fails on Claude Sonnet 5.5

```
{ "model": "claude-sonnet-5-5", "max_tokens": 1024, "temperature": 0.2, "messages": [ {"role": "user", "content": "Summarize this ticket thread."} ] }
```

_03_Your call

## Set it or remove it

If this fits

### Keep a temperature value when

- The model's current docs still list the parameter as supported.
- You have a measurable reason, such as a test that needs steadier answers.
- You are on an earlier Gemini 3 model and can leave it at the default.

Or

### Remove it when

- The model page or migration guide says sampling parameters error or are ignored.
- You added it only to tame a prompt that a clearer instruction would fix.
- You want code that survives the next model upgrade without edits.

**Upgrades break old request builders**A shared helper that always adds `temperature` will fail the first time it points at Claude Sonnet 5.5. Anthropic's checklist for moving from Sonnet 4.6 or earlier includes removing `temperature`, `top_p` and `top_k`.

_04_How it works

## Check it in 2 minutes

1. 1

### Search your request builders

Look for `temperature`, `top_p` and `top_k` in every place that builds an API request, including shared wrappers and config files.
2. 2

### Read the model's migration or parameter page

Do not assume support carries across versions. Anthropic and Google each document the change on the model-specific pages named in the sources.
3. 3

### Watch the response headers

Google says affected Gemini models return deprecation warning headers. Log them so you see the warning before it becomes a 400.
4. 4

### Test the prompt without the parameter

If quality holds, delete it. If it drops, the fix is usually in the instructions or the output format.

Questions

## Asked a lot.

1 questions people ask next, answered from the sources on this page.

_01_ Why did my Claude request fail with a 400 after I changed the model?

One documented cause on Claude Sonnet 5.5 is a sampling parameter. Anthropic's migration guide lists `temperature`, `top_p` and `top_k` among settings that return a 400 error and says to remove them.

Sources · 2

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- google.dev
- claude.com

1. 01 [Prompt design strategies (Google AI for developers)](https://ai.google.dev/gemini-api/docs/prompting-strategies) ai.google.dev · checked 2026-11-01
2. 02 [Claude Sonnet 5.5 migration guide (Claude docs)](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide) platform.claude.com · checked 2026-11-01

## Keep learning

[All glossary](/glossary)

[Learn Structured outputs AI search](/glossary/structured-outputs) [Related Tokenization AI search](/glossary/tokenization) [Read next Extended thinking AI search](/glossary/extended-thinking) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[TAM, SAM, SOM](/glossary/tam-sam-som) [Technical SEO](/glossary/technical-seo) [TF-IDF](/glossary/tf-idf) [Thin content](/glossary/thin-content)

More in AI search
[Knowledge cutoff](/glossary/knowledge-cutoff) [Large Language Model](/glossary/large-language-model) [Model Context Protocol](/glossary/model-context-protocol) [Multimodal AI](/glossary/multimodal-ai) [Prompt caching](/glossary/prompt-caching) [Prompt engineering](/glossary/prompt-engineering) [Prompt tracking](/glossary/prompt-tracking) [Reranking](/glossary/reranking) [Retrieval-Augmented Generation](/glossary/retrieval-augmented-generation) [Semantic Search](/glossary/semantic-search) [Structured outputs](/glossary/structured-outputs) [System prompt](/glossary/system-prompt) [Temperature](/glossary/temperature) [Tokenization](/glossary/tokenization) [Tool use](/glossary/tool-use) [Vector search](/glossary/vector-search) [AI Agents](/glossary/ai-agents) [AI citations](/glossary/ai-citations) [AI detection](/glossary/ai-detection) [AI Hallucination](/glossary/ai-hallucination) [AI Mode](/glossary/ai-mode) [AI Overviews](/glossary/ai-overviews) [AI search](/glossary/ai-search) [AI visibility](/glossary/ai-visibility)

Terms on this page
[Prompt engineering](/glossary/prompt-engineering) [Tokenization](/glossary/tokenization) [Structured outputs](/glossary/structured-outputs)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
