Free auditStart free
GlossaryGlossary · AI search

Temperature

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 withChatGPTClaudePerplexityGoogleAI Mode

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+
02At a glance

Anatomy: the parameter that now causes a 400

Model family

Claude 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 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."}
  ]
}
03Your 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.
04How 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.

01Why 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. 01Prompt design strategies (Google AI for developers)ai.google.dev · checked 2026-11-01
  2. 02Claude Sonnet 5.5 migration guide (Claude docs)platform.claude.com · checked 2026-11-01
Free · 2 minutes

Know the term. Now check your site.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly