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
messages: [{ role: "system", content: "You are a helpful assistant." }],
298
-
model: "gpt-4o",
303
+
model: "gpt-5",
304
+
max_completion_tokens: 250,
299
305
});
300
306
301
307
console.log(response.choices[0]);
@@ -1803,7 +1809,7 @@ paths:
1803
1809
required:
1804
1810
- variables
1805
1811
description: |
1806
-
Note: Although hyperparameters are shown grouped here (like messages, max_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'.
1812
+
Note: Although hyperparameters are shown grouped here (like messages, max_completion_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'. The `max_tokens` parameter is deprecated — use `max_completion_tokens` instead.
1807
1813
properties:
1808
1814
variables:
1809
1815
type: object
@@ -1853,7 +1859,7 @@ paths:
1853
1859
"variables": {
1854
1860
"user_input": "Hello world"
1855
1861
},
1856
-
"max_tokens": 250,
1862
+
"max_completion_tokens": 250,
1857
1863
"presence_penalty": 0.2
1858
1864
}'
1859
1865
- lang: Python
@@ -1870,7 +1876,7 @@ paths:
1870
1876
variables={
1871
1877
"user_input": "Hello world"
1872
1878
},
1873
-
max_tokens=250,
1879
+
max_completion_tokens=250,
1874
1880
presence_penalty=0.2
1875
1881
)
1876
1882
@@ -1890,7 +1896,7 @@ paths:
1890
1896
variables: {
1891
1897
user_input: "Hello world"
1892
1898
},
1893
-
max_tokens: 250,
1899
+
max_completion_tokens: 250,
1894
1900
presence_penalty: 0.2
1895
1901
});
1896
1902
@@ -1905,7 +1911,7 @@ paths:
1905
1911
"variables": {
1906
1912
"user_input": "Hello world"
1907
1913
},
1908
-
"max_tokens": 250,
1914
+
"max_completion_tokens": 250,
1909
1915
"presence_penalty": 0.2
1910
1916
}'
1911
1917
- lang: python
@@ -1923,7 +1929,7 @@ paths:
1923
1929
variables={
1924
1930
"user_input": "Hello world"
1925
1931
},
1926
-
max_tokens=250,
1932
+
max_completion_tokens=250,
1927
1933
presence_penalty=0.2
1928
1934
)
1929
1935
@@ -1943,7 +1949,7 @@ paths:
1943
1949
variables: {
1944
1950
user_input: "Hello world"
1945
1951
},
1946
-
max_tokens: 250,
1952
+
max_completion_tokens: 250,
1947
1953
presence_penalty: 0.2
1948
1954
});
1949
1955
@@ -1975,7 +1981,7 @@ paths:
1975
1981
required:
1976
1982
- variables
1977
1983
description: |
1978
-
Note: Although hyperparameters are shown grouped here (like messages, max_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'.
1984
+
Note: Although hyperparameters are shown grouped here (like messages, max_completion_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'. The `max_tokens` parameter is deprecated — use `max_completion_tokens` instead.
description: ID of the model to use. See the [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.
22285
-
example: "gpt-4-turbo"
22291
+
example: "gpt-5"
22286
22292
anyOf:
22287
22293
- type: string
22288
22294
- type: string
22289
22295
enum:
22290
22296
[
22297
+
"gpt-5",
22298
+
"gpt-5-mini",
22299
+
"gpt-5-nano",
22300
+
"o4-mini",
22301
+
"o3",
22302
+
"o3-mini",
22303
+
"o1",
22304
+
"o1-mini",
22291
22305
"gpt-4o",
22306
+
"gpt-4o-mini",
22292
22307
"gpt-4o-2024-05-13",
22293
22308
"gpt-4-turbo",
22294
22309
"gpt-4-turbo-2024-04-09",
@@ -22342,9 +22357,21 @@ components:
22342
22357
nullable: true
22343
22358
max_tokens:
22344
22359
description: |
22345
-
The maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the chat completion.
22360
+
Deprecated in favor of `max_completion_tokens`.
22361
+
22362
+
The maximum number of [tokens](https://platform.openai.com/tokenizer?view=bpe) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.
22346
22363
22347
-
The total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.
**Not supported:** o-series reasoning models (o1, o3, o3-mini, o4-mini) and GPT-5 series — use `max_completion_tokens` instead.
22367
+
type: integer
22368
+
nullable: true
22369
+
deprecated: true
22370
+
max_completion_tokens:
22371
+
description: |
22372
+
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
22373
+
22374
+
**Supported models:** GPT-5 series, o-series reasoning models (o1, o3, o3-mini, o4-mini) — required. Also supported on GPT-4o, GPT-4o-mini, GPT-4, GPT-4 Turbo, GPT-3.5 Turbo as a replacement for `max_tokens`.
22348
22375
type: integer
22349
22376
nullable: true
22350
22377
n:
@@ -24999,6 +25026,28 @@ components:
24999
25026
total_tokens:
25000
25027
type: integer
25001
25028
description: Total number of tokens used in the request (prompt + completion).
25029
+
completion_tokens_details:
25030
+
type: object
25031
+
nullable: true
25032
+
description: Breakdown of tokens used in a completion.
25033
+
properties:
25034
+
reasoning_tokens:
25035
+
type: integer
25036
+
description: Tokens generated by the model for reasoning.
25037
+
accepted_prediction_tokens:
25038
+
type: integer
25039
+
description: When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.
25040
+
rejected_prediction_tokens:
25041
+
type: integer
25042
+
description: When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion.
25043
+
prompt_tokens_details:
25044
+
type: object
25045
+
nullable: true
25046
+
description: Breakdown of tokens used in the prompt.
0 commit comments