メインコンテンツへスキップ

指定 Key の残高を照会

Management Key のみ受け付けます。key_id は現在のアカウント内で未削除の Regular Key の公開 ID である必要があります。

リクエストパラメータ: なし(key_id はパス内にあります)

レスポンス例

{
"object": "key_balance",
"currency": "USD",
"as_of": "2026-08-08T06:30:00Z",
"key": {
"id": "key_01JPRODUCTION",
"name": "Production Server",
"key_type": "regular",
"disabled": false,
"manually_disabled": false,
"limit": "200",
"limit_reset": "monthly",
"quota_scope": "usage",
"period": {
"start": "2026-07-21T08:30:00Z",
"end_exclusive": "2026-08-21T08:30:00Z"
},
"consumed_this_period": "85.5",
"consumed_today": "2.3",
"consumed": {
"all_time": "850",
"this_period": "85.5",
"today": "2.3",
"by_model": [
{
"model": "gpt-4.1",
"cost": "45"
}
],
"complete": true,
"retention_start": "2026-01-01T00:00:00Z"
},
"key_limit_remaining": "114.5",
"remaining": "114.5",
"effective_remaining": "114.5",
"usage_pct": "42.75",
"status": "active",
"status_reason": null
}
}

単一 Key のすべてのフィールドは key サブオブジェクト内にまとめて配置され、レスポンスの最上位に key_id、consumed、remaining は重複して返しません。

404 の意味

リソース探索を防ぐため、指定 Key が存在しない、削除済み、または他のアカウントに属する場合は、一律 404 key_not_found を返し、具体的な理由は区別しません。

関連エンドポイント

共通リクエスト仕様、フィールド定義、エラーコードは 残高照会API を参照してください。

オンラインサポート