Topic 3 of 6 · 4 min read
Parameter and API changes in migrations
Goal: Update an API call for a new model by fixing the parameters the migration guide changes.
Moving to a new model often means editing the request, not only the model name. Read the migration guide for the parameters it renames, removes or adds, and fix the call before you compare quality. Otherwise a 400 error, or worse a silently ignored setting, hides in your results.
Check yourself · 1 of 3
A call to a newer model fails with a 400 error saying the parameter max_tokens is not supported and to use max_completion_tokens. What is the right fix?
Why it matters
Models do not share one request format. A reasoning model may reject a setting that a chat model accepts. A newer API may rename a field. If your code swallows errors or retries on failure, a changed parameter can look like flaky quality for days.
Typical changes
- Renamed limits. OpenAI's newer chat models use
max_completion_tokensin place ofmax_tokens, because the limit now covers hidden reasoning as well as visible text. - Sampling settings. Reasoning models often reject or ignore
temperatureandtop_p. Check the model's page before you copy a value across. - Reasoning controls. Newer models add settings such as a reasoning effort level or a thinking token budget. The default may differ by model, which changes cost and latency even if you set nothing.
- Tool and message formats. Tool schemas, how a tool result is returned, and which message roles are allowed can differ across API generations.
- Output limits and context. A longer answer or hidden reasoning can hit your old output limit and cut the reply off mid-sentence.
- Removed or changed features. Prefill, stop-sequence behaviour and some response options differ by model. The guide lists them.
Before and after
resp = client.chat.completions.create(
- model="gpt-4o-2024-08-06",
+ model="o3-mini-2025-01-31",
messages=msgs,
- max_tokens=800,
- temperature=0.2,
+ max_completion_tokens=4000,
+ reasoning_effort="low",
)
Here the limit was renamed and raised because reasoning tokens count against it, the temperature was removed because the model does not accept it, and an effort setting controls cost. Check the target model's page for the exact names; they change between releases.
What goes wrong
- Copy-paste of every setting. You pass
temperature=0to a model that ignores it and assume the output is deterministic. - The old output cap. An 800 token cap on a model that reasons first leaves no room for the answer, and replies come back empty or cut off.
- Only reading the changelog headline. The list of breaking changes sits under the migration heading, not in the release post.
- Ignoring the finish reason. A
lengthstop is a sign the limit is wrong, not that the model gave a short answer.
Examples
Empty replies after a swap
A summariser moved to a reasoning model with max_tokens still at 500. Reasoning used most of the budget, so some replies were cut off with an empty text field. Raising the limit and logging finish_reason showed the cause in one run.
Reading a guide as a checklist
For each migration guide, copy its list of changes into the pull request as a checklist: parameter renamed, setting removed, new default, format change. Tick each against your code. A reviewer can see what was checked.
Key points
- A model switch often needs request changes, so read the target model's migration guide before running tests.
- Token limits can be renamed and may now include hidden reasoning tokens, so old caps can truncate answers.
- Reasoning models often reject or ignore sampling settings such as temperature, so do not copy them across.
- New effort or thinking settings have defaults that change cost and latency even when you leave them unset.
- Check the finish reason on every call; a length stop means a parameter problem, not a short answer.
Common mistakes
- Changing only the model string and assuming the rest of the request still works.
- Copying temperature and top_p to a model that ignores them and expecting repeatable output.
- Keeping an output cap sized for the old model when the new one spends tokens on reasoning.
- Retrying silently on 400 errors so a bad parameter looks like occasional flakiness.
Check yourself · 2 of 3
After switching to a reasoning model, 8% of replies are empty and finish_reason is length. The cap is still 500 tokens. What is the likely cause?
Check yourself · 3 of 3
You copy temperature=0 from an old config to a reasoning model and call it a fully repeatable setup. What should you do?
Practice items, not counted towards your mastery.
Start here
- Model deprecations (Claude docs) (opens in a new tab)DocsFree
Shows how retirement dates are announced and which replacement each retired model gets.
- Deprecations (OpenAI API) (opens in a new tab)DocsFree
The list of shutdown dates and recommended replacements for OpenAI models and endpoints.
- Claude migration guides (opens in a new tab)DocsFree
Per-model lists of changed parameters and behaviours to check when moving to a newer Claude model.