---
title: "Start a browser sign-in to a model plan [write]"
method: POST
path: "/model-subscriptions/{provider}/logins"
---

# Start a browser sign-in to a model plan \[write\]

`POST /model-subscriptions/{provider}/logins`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/model-subscriptions/{provider}/logins`
- Auth: HTTP bearer

The provider's own CLI signs in inside a short-lived sandbox; open the returned `url`, then poll GET …/logins/{loginId} until `connected`. accountId `new` adds a separate account; omitted signs in the legacy provider account. Five starts per member per 10 minutes.

## Path parameters

- `provider` 'anthropic' | 'openai' | 'cursor' | 'xai' | 'meta', required

## Request body

- BeginModelSubscriptionLogin
  - `accountId` string
  - `label` string

## Response `201`

Created

- object
  - `login` ModelSubscriptionLogin, required: A browser sign-in in progress. starting: the sandbox is booting, poll again. waiting: open `url` (and, when `acceptsCode`, submit the code the provider's page shows). connected: the subscription is stored. cleanup_pending: stored, but the sandbox has not stopped yet; poll again or DELETE. failed: start again.
    - `state` 'starting' | 'waiting' | 'connected' | 'cleanup_pending' | 'failed', required
    - `loginId` string: Opaque handle bound to the caller, the workspace and the provider; valid for 16 minutes
    - `url` string: The provider's sign-in page (waiting)
    - `userCode` string, nullable: A code to confirm on the provider's page, when it shows one
    - `acceptsCode` boolean: The provider's page shows a code to submit to /code
    - `subscription` ModelSubscription: A connected consumer AI subscription (Claude Pro/Max, ChatGPT, Cursor, Grok or Muse plan) powering eligible agents at $0 model usage. The credential itself is write-only.
      - `provider` 'anthropic' | 'openai' | 'cursor' | 'xai' | 'meta'
      - `accountId` string: Additional account identifier; omitted for the legacy provider account
      - `label` string
      - `status` 'connected' | 'needs_reconnect' | 'org_disabled': connected runs agents; needs_reconnect lost its credential; org_disabled is signed in to an organization that turned off plan access for this harness, so nothing runs on it until it is reconnected
      - `expiresAt` string, nullable
      - `lastUsedAt` string, nullable
      - `useForNewAgents` boolean
      - `createdAt` string
      - `agents` object[]: Agents in this universe running on the subscription
        - `id` string
        - `agentId` string, nullable
        - `name` string
    - `reason` string

## Other responses

- `default`: Error — { error: { code, message, request_id } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/model-subscriptions/:provider/logins/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
