POST/api/orgs/{org_id}/provider-connections/{provider}/plans/{setup_alias}/refresh-usage

プランアカウントの使用量を更新

プランのローリング使用量ウィンドウを今すぐ読み取り(期限切れ間近ならログインを更新します)、アカウントに反映します。使い切ったウィンドウはアカウントをquota_exhaustedにし、トラフィックは次のアカウントに切り替わります。Proは不要です。プロバイダーからの読み取りに失敗した場合は502です。

認証: AuthorizationヘッダーにBearer形式のAPIキー

パスパラメーター

  • org_idstring必須

    お客様の組織ID(uuid)。GET /api/whoamiで取得できます。

  • providerenum必須

    ChatGPTプランはopenai、Claudeプランはanthropic。その他のプロバイダーは404です。

    "openai""anthropic"
  • setup_aliasstring必須

    プランアカウントのハンドル。

クエリパラメーター

  • automaticboolean

    ライブポーリングです。45秒以内の読み取り値を再利用し、判定が変わった場合のみ監査記録を残します。

    既定値: false

レスポンス

  • 200

    読み取り後のプランアカウント。

    レスポンス
    • setup_aliasstring必須
    • planobject必須

      プランアカウントがキーの代わりに保持するもの。

      plan
      • labelstring必須
      • plan_typestring | null必須

        例:plus、pro、team、max。

      • primaryobject | null必須
        いずれか

        object

        • used_percentinteger必須
        • reset_atstring | null必須
        • window_minutesinteger | null必須
      • secondaryobject | null必須
        いずれか

        object

        • used_percentinteger必須
        • reset_atstring | null必須
        • window_minutesinteger | null必須
      • derivedobject | null
        いずれか

        object

        • five_hourobject | null必須
          いずれか

          object

          • requestsinteger必須
          • input_tokensinteger必須
          • cached_input_tokensinteger必須
          • output_tokensinteger必須
          • first_activitystring | null必須
          • last_activitystring | null必須
        • seven_dayobject | null必須
          いずれか

          object

          • requestsinteger必須
          • input_tokensinteger必須
          • cached_input_tokensinteger必須
          • output_tokensinteger必須
          • first_activitystring | null必須
          • last_activitystring | null必須
      • checked_atstring | null必須
      • scopeenum

        org:共有プール。account:owner_user_idが作成したAPIキーのみ。

        "org""account"
        既定値: "org"
      • owner_user_idstring | null
      • rotation_pausedboolean

        一時停止中のプランはリクエストを処理しません。

        既定値: false
      • refreshes_atstring | null

        使い切ったウィンドウにより一時停止したプランが更新される時刻。

    • statusenum必須

      プロバイダーが確認したキーの状態で、接続チェックと実際のトラフィックによって書き込まれます。provider_errorはチェック時にプロバイダーに到達できなかったことを示し、キーが不正であることを意味しません。

      "unchecked""valid""invalid""rate_limited""quota_exhausted""provider_error"
    • scopeenum必須
      "org""account"
    • owner_user_idstring | null必須
    • rotation_pausedboolean必須
  • 401

    APIキーがない、不明、または失効しています。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 403

    キーは有効ですが、この操作は許可されていません(例:プロビジョニングキー用エンドポイントでの推論キー、プラン対象外の機能)。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 404

    このハンドルのプランアカウントはありません。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 409

    保存されたログインを読み取れません。再度ログインしてください。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

  • 502

    プロバイダーの使用量の読み取りまたはトークンの更新に失敗しました。

    レスポンス
    • errorstring必須

      人が読めるメッセージ。

    • codestring

      エンドポイントが定義している場合の、安定した機械可読の理由(例:pro_required)。

    • actionstring

      エンドポイントが定義している場合の、安定した対処アクション。

    • detailsobject

      呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。

リクエスト

curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/provider-connections/openai/plans/chatgpt-team/refresh-usage?automatic=false' \
  -H "Authorization: Bearer <YOUR_API_KEY>"

レスポンス

{
  "setup_alias": "chatgpt-team",
  "plan": {
    "label": "dev@acme.example",
    "plan_type": "team",
    "primary": {
      "used_percent": 12,
      "reset_at": "2026-11-19T18:40:00Z",
      "window_minutes": 300
    },
    "secondary": {
      "used_percent": 41,
      "reset_at": "2026-11-23T09:00:00Z",
      "window_minutes": 10080
    },
    "derived": null,
    "checked_at": "2026-11-19T14:21:07.330Z",
    "scope": "org",
    "owner_user_id": null,
    "rotation_paused": false,
    "refreshes_at": null
  },
  "status": "valid",
  "scope": "org",
  "owner_user_id": null,
  "rotation_paused": false
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/provider-connections/openai/plans/chatgpt-team/refresh-usage?automatic=false