Skip to content

Commit 2fba411

Browse files
techpro-aimlapigitbook-bot
authored andcommitted
GITBOOK-625: docs: add gpt 5.2
1 parent 18b311d commit 2fba411

10 files changed

Lines changed: 555 additions & 3 deletions

File tree

docs/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@
125125
* [gpt-5.1-chat-latest](api-references/text-models-llm/openai/gpt-5-1-chat-latest.md)
126126
* [gpt-5.1-codex](api-references/text-models-llm/openai/gpt-5-1-codex.md)
127127
* [gpt-5.1-codex-mini](api-references/text-models-llm/openai/gpt-5-1-codex-mini.md)
128+
* [gpt-5.2](api-references/text-models-llm/openai/gpt-5.2.md)
129+
* [gpt-5.2-chat-latest](api-references/text-models-llm/openai/gpt-5.2-chat-latest.md)
130+
* [gpt-5.2-pro](api-references/text-models-llm/openai/gpt-5.2-pro.md)
128131
* [Perplexity](api-references/text-models-llm/perplexity/README.md)
129132
* [sonar](api-references/text-models-llm/perplexity/sonar.md)
130133
* [sonar-pro](api-references/text-models-llm/perplexity/sonar-pro.md)

docs/api-references/model-database.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api-references/text-models-llm/README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# gpt-5.2-chat-latest
2+
3+
{% columns %}
4+
{% column width="66.66666666666666%" %}
5+
{% hint style="info" %}
6+
This documentation is valid for the following list of our models:
7+
8+
* `openai/gpt-5-2-chat-latest`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/openai/gpt-5-2-chat-latest" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
The most capable model series for professional knowledge work as of December 2025.\
20+
Designed as a low-latency, highly interactive model, it offers users a natural, engaging, and adaptive conversational experience.
21+
22+
## How to Make a Call
23+
24+
<details>
25+
26+
<summary>Step-by-Step Instructions</summary>
27+
28+
:digit\_one: **Setup You Can’t Skip**
29+
30+
:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\
31+
:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
32+
33+
:digit\_two: **Copy the code example**
34+
35+
At the bottom of this page, you'll find [a code example](/broken/pages/e12f0d25d0f40c132eac99c343c2399584aa8f77#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
36+
37+
:digit\_three: **Modify the code example**
38+
39+
:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\
40+
:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to.
41+
42+
:digit\_four: <sup><sub><mark style="background-color:yellow;">**(Optional)**<mark style="background-color:yellow;"><sub></sup>**&#x20;Adjust other optional parameters if needed**
43+
44+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](/broken/pages/e12f0d25d0f40c132eac99c343c2399584aa8f77#api-schema), which lists all available parameters along with notes on how to use them.
45+
46+
:digit\_five: **Run your modified code**
47+
48+
Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds.
49+
50+
{% hint style="success" %}
51+
If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our [Quickstart guide](/broken/pages/98f0b7f12aaceb4da01ded5128089d9a7d141d1b).
52+
{% endhint %}
53+
54+
</details>
55+
56+
## API Schema
57+
58+
{% openapi-operation spec="gpt-5-2-chat-latest" path="/v1/chat/completions" method="post" %}
59+
[OpenAPI gpt-5-2-chat-latest](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-5-2-chat-latest.json)
60+
{% endopenapi-operation %}
61+
62+
## Code Example
63+
64+
{% tabs %}
65+
{% tab title="Python" %}
66+
{% code overflow="wrap" %}
67+
```python
68+
import requests
69+
import json # for getting a structured output with indentation
70+
71+
response = requests.post(
72+
"https://api.aimlapi.com/v1/chat/completions",
73+
headers={
74+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
75+
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
76+
"Content-Type":"application/json"
77+
},
78+
json={
79+
"model":"openai/gpt-5-2-chat-latest",
80+
"messages":[
81+
{
82+
"role":"user",
83+
"content":"Hello" # insert your prompt here, instead of Hello
84+
}
85+
]
86+
}
87+
)
88+
89+
data = response.json()
90+
print(json.dumps(data, indent=2, ensure_ascii=False))
91+
```
92+
{% endcode %}
93+
{% endtab %}
94+
95+
{% tab title="JavaScript" %}
96+
{% code overflow="wrap" %}
97+
```javascript
98+
async function main() {
99+
const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {
100+
method: 'POST',
101+
headers: {
102+
// insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>
103+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
104+
'Content-Type': 'application/json',
105+
},
106+
body: JSON.stringify({
107+
model: 'openai/gpt-5-2-chat-latest',
108+
messages:[
109+
{
110+
role:'user',
111+
content: 'Hello' // insert your prompt here, instead of Hello
112+
}
113+
],
114+
}),
115+
});
116+
117+
const data = await response.json();
118+
console.log(JSON.stringify(data, null, 2));
119+
}
120+
121+
main();
122+
```
123+
{% endcode %}
124+
{% endtab %}
125+
{% endtabs %}
126+
127+
<details>
128+
129+
<summary>Response</summary>
130+
131+
{% code overflow="wrap" %}
132+
```json5
133+
{
134+
"id": "chatcmpl-Clk79duTHj2Vxfm6qQtyoGV4Wv7W2",
135+
"object": "chat.completion",
136+
"created": 1765494715,
137+
"model": "gpt-5.2-chat-latest",
138+
"choices": [
139+
{
140+
"index": 0,
141+
"message": {
142+
"role": "assistant",
143+
"content": "Hello! How can I help you today? 😊",
144+
"refusal": null,
145+
"annotations": []
146+
},
147+
"finish_reason": "stop"
148+
}
149+
],
150+
"usage": {
151+
"prompt_tokens": 7,
152+
"completion_tokens": 13,
153+
"total_tokens": 20,
154+
"prompt_tokens_details": {
155+
"cached_tokens": 0,
156+
"audio_tokens": 0
157+
},
158+
"completion_tokens_details": {
159+
"reasoning_tokens": 0,
160+
"audio_tokens": 0,
161+
"accepted_prediction_tokens": 0,
162+
"rejected_prediction_tokens": 0
163+
}
164+
},
165+
"service_tier": "default",
166+
"system_fingerprint": null,
167+
"meta": {
168+
"usage": {
169+
"credits_used": 409
170+
}
171+
}
172+
}
173+
```
174+
{% endcode %}
175+
176+
</details>
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# gpt-5.2-pro
2+
3+
{% columns %}
4+
{% column width="66.66666666666666%" %}
5+
{% hint style="info" %}
6+
This documentation is valid for the following list of our models:
7+
8+
* `openai/gpt-5-2-pro`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/openai/gpt-5-2-pro" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
{% openapi-operation spec="gpt-5-2-pro-RESPONSES" path="/v1/responses" method="post" %}
20+
[OpenAPI gpt-5-2-pro-RESPONSES](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/OpenAI/gpt-5-2-pro-RESPONSES.json)
21+
{% endopenapi-operation %}
22+
23+
## How to Make a Call
24+
25+
<details>
26+
27+
<summary>Step-by-Step Instructions</summary>
28+
29+
:digit\_one: **Setup You Can’t Skip**
30+
31+
:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\
32+
:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
33+
34+
:digit\_two: **Copy the code example**
35+
36+
At the bottom of this page, you'll find [a code example](/broken/pages/2552ab2760bbc1cdbca8e717abaf9f4ece5edea2#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
37+
38+
:digit\_three: **Modify the code example**
39+
40+
:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\
41+
:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to.
42+
43+
:digit\_four: <sup><sub><mark style="background-color:yellow;">**(Optional)**<mark style="background-color:yellow;"><sub></sup>**&#x20;Adjust other optional parameters if needed**
44+
45+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](/broken/pages/2552ab2760bbc1cdbca8e717abaf9f4ece5edea2#api-schema), which lists all available parameters along with notes on how to use them.
46+
47+
:digit\_five: **Run your modified code**
48+
49+
Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds.
50+
51+
{% hint style="success" %}
52+
If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our [Quickstart guide](/broken/pages/5e7b5ff4fdd368f924cf9a40235d725385bac3f3).
53+
{% endhint %}
54+
55+
</details>
56+
57+
## API Schema
58+
59+
60+
61+
## Code Example: Using /responses Endpoint
62+
63+
{% tabs %}
64+
{% tab title="Python" %}
65+
{% code overflow="wrap" %}
66+
```python
67+
import requests
68+
import json # for getting a structured output with indentation
69+
70+
response = requests.post(
71+
"https://api.aimlapi.com/v1/responses",
72+
headers={
73+
"Content-Type":"application/json",
74+
75+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
76+
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
77+
"Content-Type":"application/json"
78+
},
79+
json={
80+
"model":"openai/gpt-5-2-pro",
81+
"input":"Hello" # Insert your question for the model here, instead of Hello
82+
}
83+
)
84+
85+
data = response.json()
86+
print(json.dumps(data, indent=2, ensure_ascii=False))
87+
```
88+
{% endcode %}
89+
{% endtab %}
90+
91+
{% tab title="JavaScript" %}
92+
{% code overflow="wrap" %}
93+
```javascript
94+
async function main() {
95+
try {
96+
const response = await fetch('https://api.aimlapi.com/v1/responses', {
97+
method: 'POST',
98+
headers: {
99+
// Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>
100+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
101+
'Content-Type': 'application/json',
102+
},
103+
body: JSON.stringify({
104+
model: 'openai/gpt-5-2-pro',
105+
input: 'Hello', // Insert your question here, instead of Hello
106+
}),
107+
});
108+
109+
if (!response.ok) {
110+
throw new Error(`HTTP error! Status ${response.status}`);
111+
}
112+
113+
const data = await response.json();
114+
console.log(JSON.stringify(data, null, 2));
115+
116+
} catch (error) {
117+
console.error('Error', error);
118+
}
119+
}
120+
121+
main();
122+
```
123+
{% endcode %}
124+
{% endtab %}
125+
{% endtabs %}
126+
127+
<details>
128+
129+
<summary>Response</summary>
130+
131+
{% code overflow="wrap" %}
132+
```json5
133+
{
134+
"id": "resp_0dd35be89958381600693b503b62048197834533b8a189267e",
135+
"object": "response",
136+
"created_at": 1765494843,
137+
"error": null,
138+
"incomplete_details": null,
139+
"instructions": null,
140+
"max_output_tokens": 512,
141+
"model": "gpt-5.2-pro-2025-12-11",
142+
"output": [
143+
{
144+
"id": "msg_0dd35be89958381600693b5042eb448197a7f6f830bc942150",
145+
"type": "message",
146+
"status": "completed",
147+
"content": [
148+
{
149+
"type": "output_text",
150+
"annotations": [],
151+
"logprobs": [],
152+
"text": "Hello! What can I help you with today?"
153+
}
154+
],
155+
"role": "assistant"
156+
}
157+
],
158+
"parallel_tool_calls": true,
159+
"previous_response_id": null,
160+
"reasoning": {
161+
"effort": "medium",
162+
"summary": null
163+
},
164+
"temperature": 1,
165+
"text": {
166+
"format": {
167+
"type": "text"
168+
},
169+
"verbosity": "medium"
170+
},
171+
"tool_choice": "auto",
172+
"tools": [],
173+
"top_p": 0.98,
174+
"truncation": "disabled",
175+
"usage": {
176+
"input_tokens": 309,
177+
"input_tokens_details": {
178+
"cached_tokens": 0
179+
},
180+
"output_tokens": 4939,
181+
"output_tokens_details": {
182+
"reasoning_tokens": 0
183+
},
184+
"total_tokens": 5248
185+
},
186+
"metadata": {},
187+
"output_text": "Hello! What can I help you with today?"
188+
}
189+
```
190+
{% endcode %}
191+
192+
</details>

0 commit comments

Comments
 (0)