DictionaryPrompt Engineering
Temperature
A creativity dial: low makes the AI's answers predictable and focused, high makes them more varied and surprising.
Definition
A sampling parameter that controls randomness: lower values favor the most probable tokens, higher values produce more varied output. Even temperature 0 is not fully deterministic across API calls. Claude models from Opus 4.7 onward accept only the default temperature (and default top_p and top_k) and return a 400 error for any other value; steer them with prompting and effort instead.
Example
temperature: 0.2 was common for code generation on older models; on Claude Opus 5.5 that request returns a 400 error, so omit the parameter.