/api/orgs/{org_id}/provider-connections/{provider}/plans/sign-in/completeComplete a plan sign-in
Redeems the returned code and stores the plan in the scope chosen at start. The state is spent whether or not the exchange succeeds (409 when unknown, expired or reused; start again). A pool sign-in is finished by its starter, an org admin, or the org's key; an account-scoped one only by the member who started it (403 plan_sign_in_not_yours).
認証: AuthorizationヘッダーにBearer形式のAPIキー
パスパラメータ
org_idstring必須Your organization id (uuid).
GET /api/whoamireturns it.providerenum必須openaifor ChatGPT plans,anthropicfor Claude plans. Any other provider answers 404.
リクエストボディ
statestring必須callbackstring必須The pasted landing address,
code#state, or the bare code.setup_aliasstring | nullThe handle, when it was not given at start.
scopeenumOptional; must equal the scope chosen at start.
レスポンス
200The stored plan account.
レスポンス
setup_aliasstring必須planobject必須What a plan account carries instead of a key.
plan
labelstring必須plan_typestring | null必須For example 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: the shared pool;account: only API keys created byowner_user_id.owner_user_idstring | nullrotation_pausedbooleanA paused plan never serves.
refreshes_atstring | nullWhen a plan paused for a spent window refreshes.
statusenum必須The provider-verified key state, written by the hookup check and by real traffic.
provider_errormeans the provider was unreachable when checked, not that the key is bad.scopeenum必須owner_user_idstring | null必須rotation_pausedboolean必須
401Missing, unknown or revoked API key.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
402Adding a plan account needs Pro.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
403Only the member who started an account-scoped sign-in may finish it.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
404The resource does not exist or belongs to another organization.
レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
409The state is unknown, expired, already used, or the handle belongs to a plan in another scope (
plan_scope_conflict).レスポンス
errorstring必須Human-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
422The provider refused the code, the handle is invalid, or
scopedisagrees with the start (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