POST/api/orgs/{org_id}/provider-connections/{provider}/plans/sign-in

Start a plan sign-in

Mints a one-time PKCE sign-in (valid 15 minutes) and returns the authorization URL to open. With completion: paste the operator pastes the address the browser lands on (ChatGPT) or the returned code into sign-in/complete; with redirect the web callback completes it. Adding a plan needs Pro with no grandfather clause (402 pro_required); re-signing in a handle the org already holds does not. Claude plans require setup_alias. An API key cannot use scope: account (422 account_scope_needs_member).

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

パスパラメータ

  • org_idstring必須

    Your organization id (uuid). GET /api/whoami returns it.

  • providerenum必須

    openai for ChatGPT plans, anthropic for Claude plans. Any other provider answers 404.

    "openai""anthropic"

リクエストボディ

  • setup_aliasstring | null

    The new account's handle (a slug, not the bare provider name). Required for Claude plans.

  • scopeenum

    account (only your own keys draw on it) needs a signed-in member, not an API key.

    "org""account"
    デフォルト: "org"

レスポンス

  • 200

    The sign-in to open.

    レスポンス
    • statestring必須
    • authorize_urlstring必須
    • callback_urlstring必須
    • completionenum必須
      "paste""redirect"
    • expires_atstring必須
  • 401

    Missing, unknown or revoked API key.

    レスポンス
    • errorstring必須

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 402

    Adding a plan account needs Pro.

    レスポンス
    • errorstring必須

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 403

    The key is valid but may not perform this action (for example an inference key on a provisioning-key route, or a feature outside your plan).

    レスポンス
    • errorstring必須

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    Not a member, or Claude plans are not enabled on this deployment (claude_plans_unavailable).

    レスポンス
    • errorstring必須

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    Missing or bare-provider handle, or scope: account from an API key (account_scope_needs_member).

    レスポンス
    • errorstring必須

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

リクエスト

curl -X POST https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/provider-connections/openai/plans/sign-in \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "setup_alias": "chatgpt-team",
  "scope": "org"
}'

レスポンス

{
  "state": "Yk3vR8pQ2wNfT6hJmZ1cXa",
  "authorize_url": "https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EXAMPLE&redirect_uri=http%3A%2F%2Flocalhost%3A1455%2Fauth%2Fcallback&code_challenge=EXAMPLE&code_challenge_method=S256&state=Yk3vR8pQ2wNfT6hJmZ1cXa",
  "callback_url": "http://localhost:1455/auth/callback",
  "completion": "paste",
  "expires_at": "2026-11-19T14:35:00.000000+00:00"
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/provider-connections/openai/plans/sign-in