Temperature is a sampling parameter controlling output randomness: low values make responses more deterministic, high values more varied and creative.
At each step a model produces a probability distribution over possible next tokens, and temperature reshapes it before sampling. Values near 0 concentrate probability on the top candidates, yielding consistent, focused output; higher values flatten the distribution, admitting less likely tokens and more variety. APIs typically accept a range around 0 to 2 with defaults near 1.
Practice is straightforward: use low temperature for extraction, classification, code, and anything evaluated for correctness, and raise it for brainstorming and creative writing where sameness is the failure mode. Even temperature 0 is not perfectly deterministic on most serving stacks, so systems requiring reproducibility need stronger guarantees than sampling settings.
Temperature has no direct price effect, but an indirect one: overly random output fails validation more often, and every retry is a fully billed request.
Last revised 2026-07-05 · All glossary terms → · Live AI model pricing →