What you need to know
Tokens
Tokens are the unit of input, output, limits and cost. The number of tokens per word varies by language and content (code, non-English text and numbers often use more), and images cost tokens roughly in proportion to their size. Use the token counting endpoint to measure a request before sending it.
The context window
The window holds everything in one request: system prompt, tools, history, documents, and the generated output, including thinking. So:
- 150,000 tokens of input plus a 40,000-token answer is too close to a 200,000-token window.
max_tokenscaps output; reaching it stops generation withstop_reason: max_tokens.- Chat history grows each turn because the app resends it; it will eventually exceed the window unless trimmed, summarized or compacted.
Sampling and non-determinism
Generation samples the next token. Temperature narrows (low) or widens (high) the choices. Even at temperature 0 outputs can differ slightly. To make output consistent: clear criteria, examples, structured output with only the fields you need, lower temperature, and validation for what still varies.
Thinking and effort
| Option | What it does | Use |
|---|---|---|
| Extended thinking with a budget | Reasons before answering; budget counts toward max_tokens | Multi-step reasoning, analysis |
| Adaptive thinking | The model decides whether and how much to think | Mixed traffic of easy and hard requests |
| Effort (low to high) | How much work the model puts in: thinking, tool calls, length | Lower for simple, fast tasks; higher for hard ones |
| Code execution tool | Real computation | Exact arithmetic instead of mental math |
With thinking, users see a delay before the first visible text; show progress, or lower effort for faster replies. max_tokens remains the hard ceiling on spend.
Prompt layout
For long documents, put the documents near the top and the question at the end, with each document clearly tagged.
In the exam
Items describe an observed behavior (cost differences, truncation, variation, slow first tokens, weak arithmetic) and ask for the explanation or the control. Reason from tokens and the window, sampling, and thinking and effort. Distractors invent surcharges or turn limits, use temperature for depth or determinism, or disable features instead of using them well.
Check your understanding
Temperature 0, identical requests, slightly different outputs. Why?
Show answer
Answer: A. Lower temperature narrows sampling but does not guarantee identical output.
A hard review needs more depth, formatting less, on one model. Which control?
Show answer
Answer: B. Effort trades thoroughness against tokens and speed.
Will this long prompt fit, and what will it cost? How do you find out first?
Show answer
Answer: D. It counts the request's input tokens without generating.
Apply it: Size Bluestem's underwriting requests
Bluestem's underwriting assistant reads an application's documents (often 120,000 tokens), thinks, and writes a 3,000-token memo. Some requests fail near the context limit, memos sometimes vary in structure, and arithmetic on cash flow is occasionally wrong. Underwriters also complain about a long wait before anything appears.
- Budget the window for a 200,000-token model.
- Make memos consistent in structure.
- Fix the arithmetic.
- Address the wait.
Done when: each change targets a mechanism, not a guess.
Show model answer
1. Count tokens per application; input capped at about 150,000 (retrieve only relevant pages beyond that); thinking budget about 16,000; max_tokens about 22,000 to cover thinking and the memo. Applications over the cap are split by document and summarized first.
2. A fixed memo schema (sections as structured fields), one example memo, lower temperature for the drafting step.
3. Give the agent the code execution tool for cash-flow calculations and instruct it to compute, not estimate.
4. Stream the response with a progress indicator during thinking; use adaptive thinking with medium effort, raising effort only for flagged complex applications.