OpenAI-compatible chat completions backed by Anthropic Claude Fable 5 — tuned for narrative and long-form writing, with adaptive thinking, image input, tool use, prompt caching and streaming. Set model to claude-fable-5. Note: this model deprecates temperature / top_p / top_k upstream; the gateway silently drops them (no error) and sampling runs at the model default. Use reasoning_effort (low / medium / high / xhigh / max) to control thinking depth instead.
📥 コンテキスト長(最大入力):約 200K トークン。
Playground で試す →認証
Authorization: Bearer YOUR_API_KEY Content-Type: application/json
コンソールで API Key を作成すると利用を開始できます。
リクエストボディ
| パラメータ | 種別 | 必須 | 説明 |
|---|---|---|---|
| model | string | はい | モデル ID。ここでは claude-fable-5 です。 |
| messages | array | はい | メッセージの配列。各要素は role(system/user/assistant)と content を持ちます。content は文字列のほか、画像を理解させる場合は {type:text} と {type:image_url} を並べた配列にできます(マルチモーダル / ビジョン)。 |
| stream | boolean | いいえ | SSE でストリーミング出力します。既定は false です。 |
| temperature | number | いいえ | 非対応です。このモデルはサンプリング系パラメータを廃止しており、ゲートウェイは temperature / top_p / top_k を黙って取り除きます(エラーにはなりません)。サンプリングはモデル既定のまま動きます。思考の深さと速度のバランスは reasoning_effort で調整してください。 |
| max_tokens | integer | いいえ | 生成するトークン数の上限。 |
| web_search | boolean | いいえ | true にするとウェブ検索を有効にします。モデルが答える前に、ゲートウェイがリアルタイムの検索結果でプロンプトを補強し、出典も添えます。tools に {"type":"web_search"} を入れても同じように動きます。 |
| reasoning_effort | string | いいえ | 思考の強度:low / medium / high / xhigh / max。高いほど深く、遅く、高価になります。思考トークンは出力単価で課金され、usage.completion_tokens に含まれます。省略するとモデルが状況に応じて決めます。ゲートウェイはこれをモデル本来の output_config.effort に変換します。ネイティブの Anthropic エンドポイントでは output_config を自分で送ることもできます。接尾辞の形(例:claude-opus-5-high)も使え、課金はベースモデルとまったく同じです。 |
リクエスト例
curl https://nezhagate.com/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "claude-fable-5", "messages": [{"role": "user", "content": "Hello"}], "stream": false}'レスポンス
{
"id": "chatcmpl_xxx",
"object": "chat.completion",
"model": "claude-fable-5",
"choices": [
{"index": 0, "message": {"role": "assistant", "content": "Hello!"}, "finish_reason": "stop"}
],
"usage": {"prompt_tokens": 11, "completion_tokens": 7, "total_tokens": 18}
}画像入力(ビジョン)
メッセージの 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": "claude-fable-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 | すべての上流回線が失敗 |