/api/orgs/{org_id}/provider-connections/{provider}/plans/sign-in/completeプランのログインを完了
返されたコードを引き換え、開始時に選んだスコープにプランを保存します。交換の成否にかかわらずstateは使用済みになります(不明、期限切れ、再利用の場合は409。やり直してください)。プールのログインは開始者、組織管理者、または組織のキーが完了でき、アカウントスコープのログインは開始したメンバーのみが完了できます(403 plan_sign_in_not_yours)。
認証: AuthorizationヘッダーにBearer形式のAPIキー
パスパラメーター
org_idstring必須お客様の組織ID(uuid)。
GET /api/whoamiで取得できます。providerenum必須ChatGPTプランは
openai、Claudeプランはanthropic。その他のプロバイダーは404です。
リクエストボディ
statestring必須callbackstring必須貼り付けたリダイレクト先のアドレス、
code#state、またはコードのみ。setup_aliasstring | null開始時に指定しなかった場合のハンドル。
scopeenum任意。開始時に選択したスコープと同じである必要があります。
レスポンス
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必須scopeenumorg:共有プール。account:owner_user_idが作成したAPIキーのみ。owner_user_idstring | nullrotation_pausedboolean一時停止中のプランはリクエストを処理しません。
refreshes_atstring | null使い切ったウィンドウにより一時停止したプランが更新される時刻。
statusenum必須プロバイダーが確認したキーの状態で、接続チェックと実際のトラフィックによって書き込まれます。
provider_errorはチェック時にプロバイダーに到達できなかったことを示し、キーが不正であることを意味しません。scopeenum必須owner_user_idstring | null必須rotation_pausedboolean必須
401APIキーがない、不明、または失効しています。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
402プランアカウントの追加にはProが必要です。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
403アカウントスコープのログインを完了できるのは、それを開始したメンバーのみです。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
404リソースが存在しないか、他の組織に属しています。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
409stateが不明、期限切れ、使用済み、またはハンドルが別のスコープのプランに属しています(
plan_scope_conflict)。レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
422プロバイダーがコードを拒否した、ハンドルが無効、または
scopeが開始時と一致しません(plan_scope_mismatch)。
リクエスト
curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/provider-connections/openai/plans/sign-in/complete' \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"state": "Yk3vR8pQ2wNfT6hJmZ1cXa",
"callback": "http://localhost:1455/auth/callback?code=ac_EXAMPLE7d2f&scope=openid&state=Yk3vR8pQ2wNfT6hJmZ1cXa",
"setup_alias": "chatgpt-team"
}'レスポンス
{
"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/sign-in/complete