テキストGPTGPT-5.2
GPT-5.2 - クイックスタート
- OpenAI SDK形式でGPT-5.2モデルを呼び出し
- 同期処理モード、リアルタイムレスポンス
- 最小限のパラメータですぐに開始
- より多くの機能が必要ですか?完全なAPIリファレンスをご確認ください
認証
Authorizationstringheader必須
## すべてのAPIにBearer Token認証が必要です ## **APIキーの取得:** [APIキー管理ページ](https://starmagic.ai/app/api-keys)にアクセスしてAPIキーを取得してください **リクエストヘッダーに追加:** ``` Authorization: Bearer YOUR_API_KEY ```
Authorization: Bearer YOUR_API_KEYリクエストボディ
application/jsonmodelenum<gpt-5.2>必須
チャット補完用モデル名
"gpt-5.2"messagesobject[]必須
会話用メッセージリスト
[
{
"role": "user",
"content": "Hello, introduce the new features of GPT-5.2"
}
]レスポンス
application/json成功
レスポンスボディ
idstring
チャット補完の一意の識別子
"chatcmpl-20251010015944503180122WJNB8Eid"modelstring
補完に使用されたモデル
"gpt-5.2"objectenum<chat.completion>
レスポンスタイプ
"chat.completion"createdinteger
補完が作成されたUnixタイムスタンプ
1760032810choicesobject[]
補完選択肢のリスト
[
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm happy to introduce GPT-5.2 to you.\n\nGPT-5.2 is the next-generation large language model with enhanced reasoning and understanding capabilities..."
},
"finish_reason": "stop"
}
]usageobject
トークン使用統計
{
"prompt_tokens": 13,
"completion_tokens": 1891,
"total_tokens": 1904,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 13,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 1480
},
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": null
}
