GPT-5.2 API इंटीग्रेशन
Rivya Public API v1 के जरिए मॉडल id gpt-5-2-chat, समर्थित इनपुट, पैरामीटर, Files API नियम, क्रेडिट और रिस्पॉन्स उदाहरणों के साथ GPT-5.2 का उपयोग करें।
gpt-5-2-chat
text, file
न्यूनतम रिक्वेस्ट के लिए जरूरी नहीं
3
चैट
चैट API: non-streaming + SSE streaming
TOKEN_BASED
20000 अक्षर
रिक्वेस्ट अनुबंध
चैट रिक्वेस्ट एक बार में एक संदेश भेजती हैं। Session हिस्ट्री Rivya स्टोर करता है; raw messages array न भेजें।
| Key | प्रकार | जरूरी | डिफॉल्ट | विवरण |
|---|---|---|---|---|
| model | string | हां | gpt-5-2-chat | gpt-5-2-chat API मॉडल id का उपयोग करें। |
| session_id | string | नहीं | - | API से बनाया गया वैकल्पिक चैट session id। नया session शुरू करने के लिए इसे छोड़ दें। |
| message | string | हां | - | उपयोगकर्ता का अगला संदेश। चैट API हिस्ट्री server-side session से आती है, raw messages array से नहीं। |
| attachments | array | नहीं | - | Files API से लौटाई गई वैकल्पिक इमेज file_id वैल्यू। बाहरी attachment URL स्वीकार नहीं किए जाते। |
| enable_web_search | boolean | नहीं | false | यह केवल तब लागू होता है जब चुना गया चैट मॉडल वेब खोज का समर्थन करता है। |
| reasoning_effort | string | नहीं | default | वैकल्पिक reasoning effort: समर्थित होने पर default, minimal, low, medium, high या xhigh। |
| client_request_id | string | नहीं | - | अपने सिस्टम में रिक्वेस्ट ट्रेस करने के लिए वैकल्पिक client-side id। |
मॉडल पैरामीटर
यह चैट मॉडल ऊपर दिए गए साझा चैट API फील्ड का उपयोग करता है। वेब खोज, इमेज file attachment, thoughts और reasoning के लिए मॉडल का समर्थन readiness डेटा में दिखाई देता है।
न्यूनतम रिक्वेस्ट
{
"model": "gpt-5-2-chat",
"message": "Write a concise launch plan for a new product image campaign"
}संदर्भ फाइल रिक्वेस्ट
{
"model": "gpt-5-2-chat",
"message": "Write a concise launch plan for a new product image campaign",
"attachments": [
{
"file_id": "file_uploaded_image_id"
}
]
}रिस्पॉन्स बनाएं
चैट एंडपॉइंट इस टर्न के लिए पूरा हुआ assistant संदेश, token usage और अंतिम क्रेडिट सेटलमेंट लौटाता है।
{
"id": "chatcmpl_msg_gpt_5_2_chat_example",
"object": "chat.completion",
"session_id": "chat_session_gpt_5_2_chat",
"model": "gpt-5-2-chat",
"created_at": "2026-05-11T00:00:00.000Z",
"message": {
"id": "assistant_message_id",
"role": "assistant",
"content": "A concise launch plan with clear next steps."
},
"usage": {
"input_tokens": 1200,
"output_tokens": 320,
"total_tokens": 1520
},
"credits": {
"reserved": 3,
"final": 3
}
}सामान्य त्रुटियां
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found, chat_model_not_supported, chat_session_conflict, chat_attachment_not_supported
चैट API Public API v1 में non-streaming और SSE streaming टर्न का समर्थन करता है। इमेज attachment के लिए Files API की file_id वैल्यू का उपयोग करना होगा।