LLM temperature: what official API docs say (and what they no longer support)
On this page
LangSmith is LangChain's hosted platform for tracing, monitoring and evaluating LLM applications and agents; Litmiq is a free browser app for quick, side-by-side prompt tests with LLM-judge scores. They overlap on one thing, running a prompt against test cases and scoring the outputs, and differ on almost everything else: accounts, hosting, scale, production monitoring and price. This page compares them using LangSmith's own documentation and pricing page as checked on 11 November 2026 and rechecked on 26 November 2026.
TL;DR · The short answer
#In official API docs, temperature is a sampling control: it changes how randomly the model picks the next token. It is not a quality score, and it is not supported the same way on every current model. This page restates what OpenAI, Google and Anthropic published in the references we opened on 26 November 2026. Litmiq has not published a temperature sweep on this URL, and we will not invent “best temperature” numbers.
Two facts matter immediately. First, Google’s official prompting guide states that Gemini 4 and Gemini 3.6+ models ignore custom temperature, top_p and top_k values (and will return 400 errors for them in a future release). Second, Anthropic’s official “Create a Message” reference, read the same day, does not list temperature or top_p as request parameters. Litmiq is independent and is not affiliated with, endorsed by, or sponsored by OpenAI, Google or Anthropic.
Key takeaways
#- OpenAI’s Create chat completion reference describes temperature as: “What sampling temperature to use, between 0 and 2.” The default is 1. “Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.” The same page documents top_p as nucleus sampling, optional, default 1, minimum 0, maximum 1: the model considers tokens with top_p probability mass.
- Google’s official wording, from the Gemini API prompt-design strategies page read on 26 November 2026, is:
- These are two official sampling controls, not synonyms for “creativity.” OpenAI documents top_p as nucleus sampling and recommends changing temperature or top_p , not both.
- Litmiq is a prompt-and-cases comparison app.
What official docs say temperature is
#OpenAI’s Create chat completion reference describes temperature as: “What sampling temperature to use, between 0 and 2.” The default is 1. “Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.” The same page documents top_p as nucleus sampling, optional, default 1, minimum 0, maximum 1: the model considers tokens with top_p probability mass. OpenAI generally recommends altering temperature or top_p but not both.
Google’s Gemini API GenerationConfig describes temperature as optional, controlling “the randomness of the output,” with values in [0.0, 2.0] and a default that varies by model. Its prompting-strategies page, in the “Experiment with model parameters” section, adds: “The temperature controls the degree of randomness in token selection.” “Lower temperatures are good for prompts that require a more deterministic or less open-ended response, while higher temperatures can lead to more diverse or creative results.” And, as Google’s wording: “A temperature of 0 is deterministic, meaning that the highest probability response is always selected.” That sentence is Google’s description of its earlier models’ sampling; it is not a Litmiq measurement, and it does not apply where Google says the parameter is ignored.
Official provider parameters (checked 26 November 2026)
#| Provider (official reference) | Parameter we found | Official range / default | Official caveat we actually read |
|---|---|---|---|
| OpenAI, Create chat completion | temperature (and top_p) | Temperature: 0–2, default 1. top_p: 0–1, default 1. | “Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models.” OpenAI points to its reasoning guide for unsupported parameters. This page does not invent that list. |
| Google, Gemini API GenerationConfig and prompt-design strategies | temperature, topP / top_p, topK / top_k | Temperature: 0.0–2.0; default varies by model. The prompting page states a default topP of 0.95. | Gemini 4 and Gemini 3.6+ ignore custom values and return deprecation warning headers (future 400). GenerationConfig also says temperature and topP are “no longer supported and [are] silently ignored on Gemini 3.6 Flash and newer models.” For earlier Gemini 3 models, Google says to keep these parameters at their defaults to avoid degraded reasoning performance. |
| Anthropic, Create a Message (platform.claude.com) | No temperature or top_p field in the official body-parameter list we read | Not listed | The official body parameters we read include output_config.effort (low, medium, high, xhigh, or max), plus fields such as thinking, tools and max_tokens. This page does not invent a Claude temperature range. |
Gemini 4 and Gemini 3.6+ ignore custom temperature
#Google’s official wording, from the Gemini API prompt-design strategies page read on 26 November 2026, is:
The
temperature,top_p, andtop_kparameters control how earlier models generate responses. Gemini 4 and Gemini 3.6+ models ignore custom values fortemperature,top_p, andtop_kand return deprecation warning headers (and will return400errors in a future release). Removetemperature,top_p, andtop_kfrom your request configurations. For earlier Gemini 3 models, keep these parameters at their default values to avoid degraded reasoning performance.
If you are on Gemini 4 (including the Carbon and Argon line discussed on Claude vs Gemini) or on Gemini 3.6 Flash and newer, turning a temperature knob in a client will not do what older Gemini tutorials describe. Confirm on Google’s live docs if you are on an earlier Gemini 3 model that still honors the parameter.
Temperature versus top-p
#These are two official sampling controls, not synonyms for “creativity.” OpenAI documents top_p as nucleus sampling and recommends changing temperature or top_p, not both. Google documents combined top-k and top-p (nucleus) sampling, and gives this official example: if tokens A, B and C have probabilities 0.3, 0.2 and 0.1 and topP is 0.5, the model will select A or B (using temperature) and exclude C. Do not treat that example as a Litmiq measurement; it is Google’s documentation of the rule.
How to test temperature on your prompts
#Litmiq is a prompt-and-cases comparison app. This page does not assume that a temperature control is visible in the app. To measure the effect of the official parameter, use a client that actually sends it (the vendor API, or a tool that exposes it) and record whether the model honors it.
- Pick one model ID and one prompt. Do not change the prompt, tools, or max tokens when you change temperature.
- Read the official parameter list for that model family first. If you are on Gemini 4 or Gemini 3.6+, Google says custom temperature is ignored. If you are calling Anthropic’s Messages API, the official create reference we read has no temperature field — do not invent one.
- If the official API allows temperature, run the same case at two official values (for OpenAI, the docs themselves mention 0.2 and 0.8 as illustrations, and a default of 1). Run more than once. Lower temperature is described as more focused, not as “identical every time,” except where a vendor (Google, for earlier models, at temperature 0) explicitly says the highest-probability token is always selected.
- Score the outputs against your own cases — expected JSON, a coding contract, a support tone. If you use a judge, define the rule first; see LLM as a judge. You can still compare two models at their default sampling in Litmiq; that is a model comparison, not a temperature sweep.
Limits of this guide
#- No Litmiq-measured accuracy, diversity, or “best temperature for X” figures appear here, because we did not run a dated sweep for this URL.
- We did not copy OpenAI’s full reasoning-guide list of unsupported parameters. The Chat Completions reference says support differs, especially on newer reasoning models; check that guide for the current list.
- Anthropic’s Messages API may change. We report only the official create reference as we read it on 26 November 2026: no
temperatureortop_pbody parameter. - Sampling is not prompting. If you need more consistent format or tone, official prompting guides also discuss examples; see What is few-shot prompting?.
FAQ
#What is LLM temperature?
In official API docs, temperature is a sampling control that changes how randomly the model selects the next token. OpenAI’s Create chat completion reference, read on 26 November 2026, places it between 0 and 2 with a default of 1, and says higher values like 0.8 are more random while lower values like 0.2 are more focused and deterministic. It is not a quality score.
What temperature should I use?
This page does not publish a best temperature. Litmiq has not run a dated sweep here. Use the official range for the API you call, then test the same prompt at more than one official value. Google’s docs say Gemini 4 and Gemini 3.6+ ignore custom temperature. Anthropic’s official Create a Message reference we read the same day does not list a temperature parameter.
Is temperature 0 fully deterministic?
Google’s official prompt-design page says that for the models where temperature still applies, a temperature of 0 is deterministic: the highest probability response is always selected. That is Google’s wording for earlier models. The same page says Gemini 4 and Gemini 3.6+ ignore custom temperature. OpenAI describes lower values as more focused and deterministic, with a default of 1; this page does not treat that as a guarantee of identical outputs on every retry.
Do Gemini 4 models honor temperature?
Not according to Google’s official prompt-design strategies page, read on 26 November 2026: Gemini 4 and Gemini 3.6+ models ignore custom temperature, top_p and top_k values, return deprecation warning headers, and will return 400 errors in a future release. Google says to remove those parameters from your request configuration.
Does the Anthropic API still have a temperature parameter?
The official Create a Message reference on platform.claude.com, read on 26 November 2026, does not list temperature or top_p in its body parameters. It does document output_config.effort (low, medium, high, xhigh, or max). This page does not invent a Claude temperature range. Re-check that live reference if you are implementing against a later revision.
Product names such as Promptfoo, LangSmith, LangChain, OpenAI and DeepEval are trademarks of their respective owners. They are used on this page only to identify those products. Litmiq is not affiliated with, endorsed by, or sponsored by those owners.
Sources
#All of the following were read on 26 November 2026. ChatGPT, GPT and OpenAI are trademarks of OpenAI. Gemini and Google are trademarks of Google. Claude and Anthropic are trademarks of Anthropic. They are used here only to identify those products. Litmiq is independent and is not affiliated with, endorsed by, or sponsored by OpenAI, Google or Anthropic.
- OpenAI, Create chat completion (
temperatureandtop_p, read 26 Nov 2026). - Google, Gemini API generateContent / GenerationConfig (read 26 Nov 2026).
- Google, Prompt design strategies, including “Experiment with model parameters” (read 26 Nov 2026).
- Anthropic, Create a Message (body parameter list, read 26 Nov 2026).
Try it in Litmiq
#Paste your system prompt, add a few test cases and compare models from nine providers side by side. Runs in your browser with your own API key.
- Free, no signup
- Runs in your browser
- Your API key, sent only to the provider you choose
Litmiq Pro
Saved suites, CI on a schedule and regression alerts for $19/month. The app stays free.
See pricing →Related guides
Compare & reference
- Prompt testing tools compared
- LangSmith alternative
- LangSmith pricing
- Litmiq vs Promptfoo
- Litmiq vs OpenAI Playground
Share this guide
Newsletter
Get Litmiq AI Weekly
Practical AI tips and the best tools of the week, in plain English.
For a general comparison of the assistants, rather than the temperature control, see ChatGPT vs Claude and Claude vs Gemini.