You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core): add GPT-5 model support with Responses API
- Automatically detect GPT-5 models by name
- Use max_completion_tokens instead of max_tokens for GPT-5
- Handle GPT-5's temperature restrictions (only supports default)
- Parse GPT-5 Responses API response format
- Add tests for GPT-5 functionality
- Update documentation with GPT-5 configuration
Fixes#1060
🤖 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: apps/site/docs/en/model-provider.mdx
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,25 @@ These are the most common configs, in which `OPENAI_API_KEY` is required.
13
13
|------|-------------|
14
14
|`OPENAI_API_KEY`| Required. Your OpenAI API key (e.g. "sk-abcdefghijklmnopqrstuvwxyz") |
15
15
|`OPENAI_BASE_URL`| Optional. Custom endpoint URL for API endpoint. Use it to switch to a provider other than OpenAI (e.g. "https://some_service_name.com/v1")|
16
-
|`MIDSCENE_MODEL_NAME`| Optional. Specify a different model name other than `gpt-4o`|
16
+
|`MIDSCENE_MODEL_NAME`| Optional. Specify a different model name other than `gpt-4o`. Supports GPT-5 models (e.g., `gpt-5`, `gpt-5-turbo`) which automatically use `max_completion_tokens` parameter |
17
+
18
+
### GPT-5 Model Support
19
+
20
+
Midscene automatically detects GPT-5 models and uses the OpenAI Responses API with the `max_completion_tokens` parameter. When you specify a GPT-5 model, Midscene will:
21
+
22
+
1. Automatically detect GPT-5 model names (any model containing "gpt-5")
23
+
2. Use the OpenAI Responses API if available
24
+
3. Send `max_completion_tokens` instead of `max_tokens` in the request
25
+
26
+
Example configuration:
27
+
```bash
28
+
export MIDSCENE_MODEL_NAME="gpt-5-turbo"
29
+
export OPENAI_API_KEY="your-api-key"
30
+
# The max tokens value will be used as max_completion_tokens for GPT-5
31
+
export OPENAI_MAX_TOKENS="4096"
32
+
```
33
+
34
+
This ensures compatibility with the new GPT-5 Responses API requirements while maintaining backward compatibility with GPT-4 and earlier models.
0 commit comments