* Cline: usage-billed models, ClinePass's and Cline's free ones, on your own Cline account — Cline's device sign-in (WorkOS device code, traded at /auth/register) or an API key; chat completions on api.cline.bot with Cline's own client-identity headers (pinned to the current CLI release — what the free models' gate reads), the non-stream data envelope unwrapped, the model list from Cline's recommended-models feed, usage from the account's balance (counted in millionths of a dollar). cline-pass answers 403 ENTITLEMENT_ERROR without the subscription and the message says so; so does an empty balance, with the top-up URL.
* cline 0.1.0: the pinned CLI version and the workos: prefix move to Cline's current client — apps/cli is at 3.0.68, and provider-auth-registry's formatProviderOAuthApiKey lowercases before it startsWith("workos:") so a token stored as WorkOS: is not double-prefixed here either; bearerOf's "once" test fails against 0.1.0.
* cline 0.1.0: the model list is Cline's whole catalog, not just the recommended feed — the title promised usage-billed models but the plugin read only recommended-models (6 paid models), while Cline's own clients also load /api/v1/ai/cline/models (loadCloudModels), so most usage-billed models were missing. The four feed arrays are now read by name instead of walking every value (a tag or description could become a model, and one in both recommended and free lost its "(free)"), clineCloud stays out as the client leaves it out, a raw-id name is prettified, and the bundled snapshot drops gemini-2.5-pro and minimax-m2.5 (not in cline-recommended.generated.ts) and gains the missing cline-pass/* entries; the parseFeed, snapshot and models-merge tests fail against 0.1.0.
* cline 0.1.0: a refresh failure no longer fails a request that still has a good token, and a rotated pair survives a failing auth.set — a 4-minute token plus a 500 from /auth/refresh answered the chat 502 and never sent it, and with auth.set throwing the next request re-spent the old refresh token, got invalid_grant and marked the account expired. fresh now keeps the current token on a transient failure while it is still good (Cline's getValidClineCredentials), failing only once it has expired, and the latest rotated pair is held in memory beside the save (kiro's held), used when getAuth still hands back the spent token; the still-good-token and rotated-pair tests fail against 0.1.0.
* cline 0.1.0: failure() keys on Cline's error codes and whole phrases, not loose substrings — a 403 whose text mentioned "tokens" (max_tokens exceeds…) became "the sign-in lapsed — sign in again" and lost the real message, and any message containing "credit" became a 429 usage limit. The 401/403 token check, the out-of-credits and entitlement checks and the 429 check now match what Cline's client matches (ENTITLEMENT_ERROR, insufficient_credits, SPEND_LIMIT_EXCEEDED, the not-subscribed wording), and a renewed token clears the lapse mark through the error path too as qoder's renewed() does; the codes-and-phrases and renewed-mark tests fail against 0.1.0.
* cline 0.1.0: device polling grows the interval for good and rides out a bad poll — slow_down raised it for one poll only (RFC 8628 and Cline's pollWorkOSTokens do interval += 1 permanently), the minimum was 0.25s where the client clamps to 1s, and a single 5xx, non-JSON reply or network error ended the sign-in with "the token answer had no access token". The poll now keeps polling through those; the slow_down, one-second and bad-poll tests fail against 0.1.0.
* cline 0.1.0: the held pair covers every refresh token this run has spent, not only the last — when auth.set goes on failing (which a store that failed once usually does) getAuth keeps handing back the first pair, and a second rotation overwrote held.from, so the third request refreshed the already-spent r1 again: /auth/refresh went r1, r2, r1 and the chat answered 401 expired. held.from is a Set every rotation adds to now, and the held pair is used whenever the refresh token getAuth hands back is in it; the two-rotation test fails against 0.1.0 (200, 200, 401).
* cline 0.1.0: X-CORE-VERSION moves to 0.0.90 with the CLI release — the header set pinned 3.0.68 beside 0.0.89, but cline@3.0.68 depends on @cline/core 0.0.90 (0.0.89 is what 3.0.67 shipped) and resolveProviderRequestHeaders sends X-CORE-VERSION from that dependency, so the number the comment calls the one that has to match was a release behind; the client-header test pins the pair now and fails against 0.1.0.
* cline 0.1.0: a poll reply that isn't JSON and isn't a 5xx fails the sign-in at once — a body that wouldn't parse was read as WorkOS having a moment, so an HTML 400 (a proxy's error page, say) kept the poll going to the deadline, ten minutes, before failing there anyway. Only a network error and a 5xx are a poll to try again now; a 4xx that isn't JSON is the poll refused. The refusal test fails against 0.1.0.
* cline 0.1.0: a renewal's mark survives a network error on the chat itself — the 502 the fetch throws after a renewal returned without signed(..., renewed(cred)), so the request that never left the machine dropped the mark while the request that came back refused kept it; it is wrapped the way the !res.ok path is. The network-error test fails against 0.1.0.
* cline 0.1.0: the held pair is kept per rotation chain, so no account is sent on another's token — magpie calls ClinePlugin once for the provider and hands every account its own getAuth, so the one `held` pair outlived them: with two accounts, a save failing every time and every token wanting renewal, A, B, A went out as A-jwt1, B-jwt1, B-jwt2 and A's third request refreshed with B's token, spending it and billing B (yetone's two-loader repro, page-for-page the same). A spent refresh token now maps to the newest pair its own chain reached — the token getAuth handed back and the one the refresh spent both point at that chain — so a request offering either finds its own account's pair; the per-chain test fails against 0.1.0 on the third request's Authorization, with the 51 before it passing.
@magpie-community/opencode-cline-auth
Cline (cline.bot) on your own Cline account: the models Cline's gateway
serves — usage-billed models, ClinePass's and Cline's free models alike.
Provider id: cline.
Signing in
- Cline device sign-in — the flow Cline's own client runs: the plugin asks
WorkOS for a device code and opens the approval page, polls until you
approve, then trades the WorkOS tokens at Cline's
/api/v1/auth/registerfor the account's own token pair. - Cline API key — create one at app.cline.bot → Settings → API Keys and paste it. Sent as a plain Bearer key.
The sign-in is kept where OpenCode keeps auth (auth.json under the data
directory); magpie keeps plugin sign-ins in its own store
(~/.config/magpie/plugin-auth.json). Access tokens are renewed through
/api/v1/auth/refresh when they near expiry — Cline rotates the refresh
token, and the rotated pair is saved back the moment it arrives (and kept in
memory beside the store, so a save that fails can't leave the next request
spending the token that was already spent). Refreshes are serialized, so two
requests renewing at once can't spend one token and lose the other. A refresh
that fails for a while keeps the token that is still good, as Cline's own
client does; only a token that has actually expired is treated as the sign-in
gone.
Requests
Chat completions go to https://api.cline.bot/api/v1/chat/completions in
OpenAI's format (streaming included), with Authorization: Bearer workos:<access token> for a signed-in account or the raw API key, and the
full client-identity header set Cline's own clients send (HTTP-Referer,
X-Title, User-Agent: Cline/<version>, X-CLIENT-TYPE: cline-cli,
X-CLIENT-VERSION, X-PLATFORM, X-PLATFORM-VERSION, X-CORE-VERSION,
X-IS-MULTIROOT, and a per-task X-Task-ID) — pinned to Cline's current CLI
release, which is also what the free models' gate reads; when Cline ships a
new release, move the pinned numbers in index.mjs along. Auth and account
requests carry the same identity. A finished non-streaming answer rides in a
{"data": …} envelope the official clients take apart; the plugin takes it
apart too. The model list is read from
/api/v1/ai/cline/recommended-models and /api/v1/ai/cline/models (neither
needs a sign-in); usage reads /api/v1/users/me and the account's /balance
(its balance is counted in millionths of a dollar).
Models
The list is Cline's own, merged from the two feeds its clients read: the
recommended-models feed (its recommended picks, its free models and
ClinePass's) and the whole cloud catalog (/ai/cline/models, where the
usage-billed models the recommended feed doesn't name live). Refreshed from
the live feeds whenever they answer; until then a bundled snapshot of the
recommended list, Cline's own default (anthropic/claude-sonnet-5) among it.
Cline's clineCloud group is left out, as Cline's own clients leave it out
unless they opt in.
- The free group (
cline-free/…,stealth/…) costs nothing — the names say "(free)". They are gated on the client surface a request claims; the plugin claims what it is, and the gate takes it. If Cline ever narrows that gate to its own apps, those models go away. - The ClinePass group (
cline-pass/…) needs a ClinePass subscription — the names say so, and asking without one answers 403. - The rest are usage-billed against the account's Credits balance.
Not included
- Cline's MCP and web-search endpoints — a chat provider only.
- Team/organization account switching.