OpenAI-compatible chat completions. Supports streaming (stream), multi-turn chat and structured tasks. Switch models by changing the model field. This model also returns a reasoning summary: choices[].message.reasoning_content when non-streaming, choices[].delta.reasoning_content when streaming. The answer itself stays in content and is never mixed with the reasoning, so clients that only read content need no changes. When reasoning_effort is omitted the gateway requests the medium tier (the model's own default) and the summary comes back all the same. Billing: thinking tokens are charged at the output rate and are included in usage.completion_tokens; usage.completion_tokens_details.reasoning_tokens breaks out how many were reasoning -- those tokens are billed whether or not you read the field. Note that OpenAI exposes only a summary of the reasoning, never the raw chain of thought, so this field is usually short. Note: this model is served over a ChatGPT-subscription upstream that does not accept temperature / top_p / max_tokens / max_completion_tokens / frequency_penalty / presence_penalty -- sending them is silently ignored (no error). Use reasoning_effort for thinking depth and prompt wording for length. For image input use a base64 data: URI; a public image URL may time out upstream.
📥 コンテキスト長(最大入力):約 272K トークン(GPT-5 系のコンテキスト長。システムプロンプト分もこの枠に含まれます)。
Playground で試す →認証
Authorization: Bearer YOUR_API_KEY Content-Type: application/json
コンソールで API Key を作成すると利用を開始できます。
リクエストボディ
| パラメータ | 種別 | 必須 | 説明 |
|---|---|---|---|
| model | string | はい | モデル ID。gpt-5.5 を指定してください。 |
| messages | array | はい | メッセージの配列。各要素は role(system/user/assistant)と content を持ちます。content は文字列のほか、画像を理解させる場合は {type:text} と {type:image_url} を並べた配列にできます(マルチモーダル / ビジョン)。 |
| stream | boolean | いいえ | SSE でストリーミング出力します。既定は false です。 |
| reasoning_effort | string | いいえ | 推論の強度:low / medium / high / xhigh。思考の深さと速度を引き換えにします。強度が低いほど応答は速くなります。省略した場合、ゲートウェイはモデル既定の medium で要求します。 |
| web_search | boolean | いいえ | true にするとウェブ検索を有効にします。モデルが答える前に、ゲートウェイがリアルタイムの検索結果でプロンプトを補強し、出典も添えます。tools に {"type":"web_search"} を入れても同じように動きます。 |
| tools | array | いいえ | 関数呼び出し。OpenAI 標準の tools 配列をそのまま渡します。モデルが呼び出すと判断した場合、finish_reason=tool_calls とともに tool_calls が返ります。特定のツールを強制したいときは tool_choice と組み合わせてください。 |
| response_format | object | いいえ | 構造化出力。{"type":"json_object"} を渡すと、モデルは妥当な JSON だけを返します。 |
リクエスト例
curl https://nezhagate.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [{"role": "user", "content": "Hello"}],
"stream": false
}'レスポンス
{
"id": "chatcmpl_xxx",
"object": "chat.completion",
"model": "gpt-5.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"reasoning_content": "**Weighing the options** ... (a summary of how the model reasoned)",
"content": "Hello!"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 11,
"completion_tokens": 105,
"total_tokens": 116,
"completion_tokens_details": {"reasoning_tokens": 43}
}
}画像入力(ビジョン)
メッセージの content 配列に画像を入れると、モデルがそれを解析します(画像についての質問、文字の読み取り / OCR など)。image_url には公開画像のリンクか、インラインの base64 データ URL(data:image/png;base64,...)を指定できます。マルチモーダル対応モデル(gpt-5.5、gemini シリーズなど)で利用できます。
curl https://nezhagate.com/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gpt-5.5", "messages": [{"role": "user", "content": [{"type": "text", "text": "この画像には何が写っていますか?"}, {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}]}]}'エラーコード
| Code | 説明 |
|---|---|
| 401 | API Key が欠落または無効 |
| 402 | 残高不足または Key が上限超過 |
| 400 | モデルまたはパラメータが非対応 |
| 429 | 上流のレート制限 |
| 502 | すべての上流回線が失敗 |