I want to tell you about the moment in week one of Anthropic’s API course that made me stop, reread the slide, and laugh out loud at myself.
It was the word “temperature.”
Not because it’s complicated. It’s actually one of the simpler concepts in the course. But I’d been thinking about it completely backwards — and I suspect I’m not alone.
What temperature actually is
When you’re working with a language model through the API, you can pass a temperature parameter with your request. It’s a number, typically between 0 and 1.
Here’s what it controls: how creative the model gets.
Not how accurate. Not how confident. Not how warm and friendly. Creative. As in — how far is it willing to roam from the most statistically likely next word?
At temperature 0, the model gets locked in. Deterministic. Give it the same prompt twice, and you’ll get essentially the same output twice. It’s making the “safest” choice at every step — highest probability token, every time.
Turn temperature up toward 1, and it starts taking chances. The outputs get more varied, more surprising, more… weird. Sometimes brilliantly weird. Sometimes just weird.
# Low temperature — precise, predictable, repeatable
response = client.messages.create(
model="claude-haiku-4-5",
max_tokens=1024,
temperature=0.0, # locked in
messages=[{"role": "user", "content": prompt}]
)
# High temperature — creative, varied, unpredictable
response = client.messages.create(
model="claude-haiku-4-5",
max_tokens=1024,
temperature=1.0, # let it cook
messages=[{"role": "user", "content": prompt}]
)
The part that actually got me
For high-creativity, high-temperature use cases, Anthropic recommends its cheaper model. Haiku over Sonnet. The budget option.
The expensive flagship model — Sonnet, Opus — those are for precision work. Structured outputs. Complex multi-step reasoning. Tasks where you need the right answer, consistently, reliably.
The affordable model? Apparently, it’s better when you want the AI to go exploring a little.
Which is… not how I would have predicted this. My mental model, before the course, was basically: more money = better at everything, including creativity. Like paying for the premium paint colors.
But the more I thought about it, the more it actually makes sense. The more capable model has been trained harder to be correct — to converge on the most accurate, most reasonable, most defensible response. Which is exactly what you want when you need precision.
When you want the model to brainstorm, to explore, to give you ten different angles on a problem instead of the one most correct answer… that relentless drive toward accuracy is actually working against you. The model that’s a little less fixated on being right turns out to be a better creative partner.
Someone in a Slack thread I follow put it well: the smarter the model, the harder it tries to give you the “right” answer — even when right isn’t what you need.
Where this actually matters
A few use cases where temperature is the dial you should be thinking about:
Low temperature (0 to 0.3) — when you need consistency:
- Parsing structured data from unstructured text
- Generating code from a spec
- Classifying inputs into defined categories
- Anything where “same input, same output” is a feature, not a bug
High temperature (0.7 to 1.0) — when you need variety:
- Brainstorming and ideation
- Generating multiple draft options to choose from
- Creative writing, marketing copy, social posts
- Any task where surprising yourself is part of the goal
The one I hadn’t thought about: testing. If you’re evaluating how a prompt performs across a range of inputs, running it at a consistent low temperature gives you reproducible results you can actually compare. Crank the temperature up, and your test results become noise. This came up in the Prompt Evaluation section of the course, and it’s the kind of thing that seems obvious in retrospect and isn’t at all obvious before someone tells you.
Where I am in the Academy
The API course isn’t the first one I’ve taken. I’ve got Claude 101 and the API course certified now, with the full developer track ahead of me: Claude Code 101, Claude Code in Action, Agent Skills, Subagents, MCP Introduction, MCP Advanced.
As I go, I’m going to keep writing about the moments that actually made me stop and reconsider something. Temperature was the first one. It won’t be the last.
The Anthropic Academy is free, self-paced, and certified. If you’re building with Claude or planning to — it’s worth your time.