The Chat Completions API accepts dozens of parameters. Here's a comprehensive reference for the most important ones:
| Parameter | Type | Default | Description |
|---|---|---|---|
temperature | float | 1.0 | Sampling temperature 0–2. Higher = more random. Don't combine with top_p. |
top_p | float | 1.0 | Nucleus sampling probability mass (0–1). Use instead of temperature, not both. |
frequency_penalty | float | 0 | −2.0 to 2.0. Penalizes repeated tokens based on frequency. |
presence_penalty | float | 0 | −2.0 to 2.0. Penalizes tokens already present, encouraging new topics. |
max_completion_tokens | int | null | Upper bound on total tokens generated (visible + reasoning). Preferred over deprecated max_tokens. |
reasoning_effort | string | "medium" | For reasoning models: none, low, medium, high, xhigh. |
verbosity | string | "medium" | Response length control: low, medium, high. |
service_tier | string | "auto" | auto, default, flex (cheaper/slower), priority (faster/costlier). |
stream | bool | false | Enable Server-Sent Events streaming. |
response_format | object | — | text, json_object, or json_schema for structured outputs. |
tools | array | — | List of tool/function definitions the model may call. |
tool_choice | string/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.