1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const axios = require('axios');
const fs = require('fs');
const path = require('path');
// helper function to help you convert your local images into base64 format
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/gpt-5.2";
const data = {
"messages": [
{
"role": "user",
"content" : "tell me a joke on cats"
},
{
"role": "assistant",
"content" : "here is a joke about cats..."
},
{
"role": "user",
"content" : "now a joke on dogs"
},
]
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();An array of objects containing the role and content
Could be "user", "assistant" or "system".
A string containing the user's query or the assistant's response.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Edited by Segmind Team on December 28, 2025.
ChatGPT 5.2 stands as OpenAI's supreme AI language model that matches human-expert proficiency in tasks that require knowledge-intensive and reasoning performance. It surpasses earlier versions in terms of performance with major leaps in mathematical reasoning, coding precision, and multimodal processing, thus handling text, images, charts, and documents while sharply curbing hallucinations, i.e., generating false or inaccurate information that is presented as fact. ChatGPT 5.2 is offered in three variants - Instant, Thinking, and Pro - which seamlessly adapt to suit varied needs, from chat queries to in-depth analysis and research. This model marks a transformative leap in the AI realm, empowering developers and businesses with a dependable base for precision-driven, context-based applications.
What makes ChatGPT 5.2 different from GPT-4?
GPT-5.2 delivers three times higher reasoning scores, near-perfect accuracy on math/coding benchmarks, and significantly fewer hallucinations. Therefore, its multimodal capabilities are vastly improved for real-world document and image analysis, making it superior to GPT-4.
Which version should I use: Instant, Thinking, or Pro?
ChatGPT 5.2 offers three variants that are meant to perform specific tasks: Instant suits conversational AI and rapid prototyping; Thinking excels at complex reasoning tasks like strategy planning or technical problem-solving; Pro provides maximum accuracy for research, legal analysis, and enterprise decision-making.
Does it support image analysis?
Yes, GPT-5.2 processes images as well, making it ideal for analyzing charts, diagrams, medical scans, and visual documents. Also, providing high-resolution images will yield better extraction accuracy.
Is ChatGPT 5.2 suitable for production applications?
Yes, ChatGPT 5.2 offers reduced error rates and consistent performance, making it reliable for enterprise deployments that require high accuracy and minimal supervision.
What are the input requirements?
Primarily, the model needs a text prompt; images are optional but enhance multimodal tasks. Furthermore, no special formatting is required; natural language queries generate the best results.
Can it handle multi-step reasoning problems?
Yes, ChatGPT 5.2 is designed to handle multi-step reasoning problems, especially its 'Thinking' and 'Pro' versions. The model also excels in breaking down complex problems into logical steps and maintaining context throughout extended reasoning chains.