Skip to content

Commit a8938cd

Browse files
ChesarsLingXuanYin
authored andcommitted
docs(openai): Document reasoning_effort summary field options (BerriAI#16549)
Related to PR BerriAI#16210 which fixed automatic summary field addition Changes: - Document reasoning_effort string vs dict formats - Add summary field options (auto, detailed, concise) - Add table of supported reasoning_effort values by GPT-5 model - Clarify model-specific support and limitations - Note that summary field requires org verification The previous implementation automatically added summary field causing 400 errors for unverified orgs. Now users can opt-in by passing reasoning_effort as dict with explicit summary field.
1 parent e4b36a8 commit a8938cd

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

docs/my-website/docs/providers/openai.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,77 @@ Expected Response:
410410

411411
```
412412

413+
### Advanced: Using `reasoning_effort` with `summary` field
414+
415+
By default, `reasoning_effort` accepts a string value (`"low"`, `"medium"`, `"high"`, `"minimal"`) and only sets the effort level without including a reasoning summary.
416+
417+
To opt-in to the `summary` feature, you can pass `reasoning_effort` as a dictionary. **Note:** The `summary` field requires your OpenAI organization to have verification status. Using `summary` without verification will result in a 400 error from OpenAI.
418+
419+
<Tabs>
420+
<TabItem value="sdk" label="SDK">
421+
```python
422+
# Option 1: String format (default - no summary)
423+
response = litellm.completion(
424+
model="openai/responses/gpt-5-mini",
425+
messages=[{"role": "user", "content": "What is the capital of France?"}],
426+
reasoning_effort="high" # Only sets effort level
427+
)
428+
429+
# Option 2: Dict format (with optional summary - requires org verification)
430+
response = litellm.completion(
431+
model="openai/responses/gpt-5-mini",
432+
messages=[{"role": "user", "content": "What is the capital of France?"}],
433+
reasoning_effort={"effort": "high", "summary": "auto"} # "auto", "detailed", or "concise" (not all supported by all models)
434+
)
435+
```
436+
</TabItem>
437+
438+
<TabItem value="proxy" label="PROXY">
439+
```bash
440+
# Option 1: String format (default - no summary)
441+
curl -X POST 'http://0.0.0.0:4000/chat/completions' \
442+
-H 'Content-Type: application/json' \
443+
-H 'Authorization: Bearer sk-1234' \
444+
-d '{
445+
"model": "openai/responses/gpt-5-mini",
446+
"messages": [{"role": "user", "content": "What is the capital of France?"}],
447+
"reasoning_effort": "high"
448+
}'
449+
450+
# Option 2: Dict format (with optional summary - requires org verification)
451+
# summary options: "auto", "detailed", or "concise" (not all supported by all models)
452+
curl -X POST 'http://0.0.0.0:4000/chat/completions' \
453+
-H 'Content-Type: application/json' \
454+
-H 'Authorization: Bearer sk-1234' \
455+
-d '{
456+
"model": "openai/responses/gpt-5-mini",
457+
"messages": [{"role": "user", "content": "What is the capital of France?"}],
458+
"reasoning_effort": {"effort": "high", "summary": "auto"}
459+
}'
460+
```
461+
</TabItem>
462+
</Tabs>
463+
464+
**Summary field options:**
465+
- `"auto"`: System automatically determines the appropriate summary level based on the model
466+
- `"concise"`: Provides a shorter summary (not supported by GPT-5 series models)
467+
- `"detailed"`: Offers a comprehensive reasoning summary
468+
469+
**Note:** GPT-5 series models support `"auto"` and `"detailed"`, but do not support `"concise"`. O-series models (o3-pro, o4-mini, o3) support all three options. Some models like o3-mini and o1 do not support reasoning summaries at all.
470+
471+
**Supported `reasoning_effort` values by model:**
472+
473+
| Model | Default (when not set) | Supported Values |
474+
|-------|----------------------|------------------|
475+
| `gpt-5` | `medium` | `minimal`, `low`, `medium`, `high` |
476+
| `gpt-5-mini` | `medium` | `minimal`, `low`, `medium`, `high` |
477+
| `gpt-5-codex` | `adaptive` | `low`, `medium`, `high` (no `minimal`) |
478+
| `gpt-5-pro` | `high` | `high` only |
479+
480+
**Note:** `gpt-5-pro` only accepts `reasoning_effort="high"`. Other values will return an error. When `reasoning_effort` is not set (None), OpenAI defaults to the value shown in the "Default" column.
481+
482+
See [OpenAI Reasoning documentation](https://platform.openai.com/docs/guides/reasoning) for more details on organization verification requirements.
483+
413484
## OpenAI Chat Completion to Responses API Bridge
414485

415486
Call any Responses API model from OpenAI's `/chat/completions` endpoint.

0 commit comments

Comments
 (0)