C.W.K.
Stream
Lesson 08 of 08 · published

Parameters Deep Dive

~22 min · temperature, top_p, seed, params

Level 0Tokenizer
0 XP0/54 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

The Chat Completions API accepts dozens of parameters. Here's a comprehensive reference for the most important ones:

ParameterTypeDefaultDescription
temperaturefloat1.0Sampling temperature 0–2. Higher = more random. Don't combine with top_p.
top_pfloat1.0Nucleus sampling probability mass (0–1). Use instead of temperature, not both.
frequency_penaltyfloat0−2.0 to 2.0. Penalizes repeated tokens based on frequency.
presence_penaltyfloat0−2.0 to 2.0. Penalizes tokens already present, encouraging new topics.
max_completion_tokensintnullUpper bound on total tokens generated (visible + reasoning). Preferred over deprecated max_tokens.
reasoning_effortstring"medium"For reasoning models: none, low, medium, high, xhigh.
verbositystring"medium"Response length control: low, medium, high.
service_tierstring"auto"auto, default, flex (cheaper/slower), priority (faster/costlier).
streamboolfalseEnable Server-Sent Events streaming.
response_formatobjecttext, json_object, or json_schema for structured outputs.
toolsarrayList of tool/function definitions the model may call.
tool_choicestring/obj"auto"none, auto, required, or specific function name.

Key changes in 2025-2026: max_tokens is deprecated in favor of max_completion_tokens. The reasoning_effort parameter now includes "none" and "xhigh". New parameters include verbosity, prompt_cache_key, prompt_cache_retention, and safety_identifier.

External links

Exercise

Run the same prompt 5 times each at temperature 0, 0.7, and 1.2. Print the first 80 chars of each. Then add seed=42 to all three, run 5 more, and observe how convergence changes. Write 2 sentences on what you actually saw.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.