diff --git a/docs/user/usage.md b/docs/user/usage.md
index 447924a072eff..4679a5fe48b34 100644
--- a/docs/user/usage.md
+++ b/docs/user/usage.md
@@ -133,10 +133,11 @@ belong to the remote server. Limits need an OpenCode Go API key, or an OpenCode
in OpenCode with an API key. A Console browser sign-in alone does not report them. You can also add
your Go API key as `OPENCODE_API_KEY` in the OpenCode instance's **Environment variables**, then
refresh provider status. Cursor reports
-its monthly allowance, including separate Auto and API usage, using the CLI login or
-`CURSOR_AUTH_TOKEN`. On macOS, this includes the default Keychain login after you enable Cursor
-usage. Keychain login is used for limits only with Cursor's default API endpoint. If you configure
-a custom Cursor endpoint, use an explicit token or file-based CLI login for limits.
+its monthly allowance, including separate Auto and API usage, using the T3 browser sign-in, the CLI
+login, or `CURSOR_AUTH_TOKEN`. On macOS, this includes the default Keychain login after you enable
+Cursor usage. Keychain login is used for limits only with Cursor's default API endpoint. If you
+configure a custom Cursor endpoint, use an explicit token or file-based CLI login for limits.
+An explicit `CURSOR_API_KEY` does not report subscription limits.
Grok reports the remaining subscription allowance and reset time for its current billing period
after signing in with `grok login`. Explicit `XAI_API_KEY` connections and custom authentication
diff --git a/packages/provider-cursor/src/server/driver.test.ts b/packages/provider-cursor/src/server/driver.test.ts
index 5a3202fd20e4d..c5e31178ec02e 100644
--- a/packages/provider-cursor/src/server/driver.test.ts
+++ b/packages/provider-cursor/src/server/driver.test.ts
@@ -21,6 +21,7 @@ import * as Option from "effect/Option";
import * as Stream from "effect/Stream";
import { vi } from "vite-plus/test";
import * as HttpClient from "effect/http/HttpClient";
+import * as HttpClientResponse from "effect/http/HttpClientResponse";
import {
DEFAULT_HANDOFF_TOKEN_CAP,
@@ -61,7 +62,18 @@ const layerTest = TestProviderHost.layer({ runBackgroundWork: false }).pipe(
Layer.provideMerge(
Layer.succeed(
HttpClient.HttpClient,
- HttpClient.make(() => Effect.die("Disabled Cursor must not make an HTTP request")),
+ HttpClient.make((request) => {
+ if (request.url.includes("GetCurrentPeriodUsage")) {
+ expect(request.headers.authorization).toBe("Bearer instance-browser-key");
+ return Effect.succeed(
+ HttpClientResponse.fromWeb(
+ request,
+ Response.json({ planUsage: { totalPercentUsed: 42 } }),
+ ),
+ );
+ }
+ return Effect.die("Disabled Cursor must not make an HTTP request");
+ }),
),
),
);
@@ -141,6 +153,9 @@ it.layer(layerTest)("CursorDriver", (it) => {
email: "cursor@example.com",
},
setup: { canAuthenticate: true, canInstall: false },
+ usageLimits: {
+ windows: [{ id: "totalPercentUsed", usedPercent: 42 }],
+ },
});
const threadId = ThreadId.make("cursor-browser-thread");
const modelSelection = { instanceId: input.instanceId, model: "auto" };
diff --git a/packages/provider-cursor/src/server/driver.ts b/packages/provider-cursor/src/server/driver.ts
index de7251fb56b10..1ea54b61074d4 100644
--- a/packages/provider-cursor/src/server/driver.ts
+++ b/packages/provider-cursor/src/server/driver.ts
@@ -10,7 +10,7 @@ import * as FileSystem from "effect/FileSystem";
import * as Path from "effect/Path";
import * as Schema from "effect/Schema";
import * as HttpClient from "effect/http/HttpClient";
-import { readCursorUsageLimits } from "./usageLimits.ts";
+import { cursorUsageLimitsEnvironment, readCursorUsageLimits } from "./usageLimits.ts";
import * as ProviderHost from "@t3tools/provider-core/server/ProviderHost";
import { makeCursorTextGeneration } from "./textGeneration.ts";
@@ -236,7 +236,10 @@ export const CursorDriver: ProviderDriver<
Effect.flatMap((settings) =>
readCursorUsageLimits(
effectiveConfig,
- { ...processEnv, CURSOR_API_KEY: apiKey },
+ cursorUsageLimitsEnvironment(processEnv, {
+ apiKey,
+ usesApiKey: auth.usesApiKey,
+ }),
settings.cursorKeychainUsageEnabled,
),
),
diff --git a/packages/provider-cursor/src/server/usageLimits.test.ts b/packages/provider-cursor/src/server/usageLimits.test.ts
index 1b4cadf88ae3f..dc9de9ac80954 100644
--- a/packages/provider-cursor/src/server/usageLimits.test.ts
+++ b/packages/provider-cursor/src/server/usageLimits.test.ts
@@ -7,7 +7,11 @@ import * as Path from "effect/Path";
import * as HttpClient from "effect/http/HttpClient";
import * as HttpClientResponse from "effect/http/HttpClientResponse";
import * as CursorKeychain from "./CursorKeychain.ts";
-import { cursorUsageResponseToLimits, readCursorUsageLimits } from "./usageLimits.ts";
+import {
+ cursorUsageLimitsEnvironment,
+ cursorUsageResponseToLimits,
+ readCursorUsageLimits,
+} from "./usageLimits.ts";
const withNodeServices = (
effect: Effect.Effect,
@@ -23,6 +27,33 @@ const withNodeServices = (
describe("Cursor usage limits", () => {
const checkedAt = "2026-09-16T00:00:00.000Z";
+ it("maps browser sessions to CURSOR_AUTH_TOKEN and keeps explicit API keys as CURSOR_API_KEY", () => {
+ expect(
+ cursorUsageLimitsEnvironment(
+ { CURSOR_API_KEY: "stale-env-key", CURSOR_AUTH_TOKEN: "configured-auth" },
+ { apiKey: "session-token", usesApiKey: false },
+ ),
+ ).toEqual({
+ CURSOR_API_KEY: undefined,
+ CURSOR_AUTH_TOKEN: "configured-auth",
+ });
+ expect(
+ cursorUsageLimitsEnvironment(
+ { CURSOR_API_KEY: "stale-env-key" },
+ { apiKey: "session-token", usesApiKey: false },
+ ),
+ ).toEqual({
+ CURSOR_API_KEY: undefined,
+ CURSOR_AUTH_TOKEN: "session-token",
+ });
+ expect(
+ cursorUsageLimitsEnvironment({ HOME: "/tmp" }, { apiKey: "user-api-key", usesApiKey: true }),
+ ).toEqual({
+ HOME: "/tmp",
+ CURSOR_API_KEY: "user-api-key",
+ });
+ });
+
it("uses the advertised percentages and billing-cycle reset", () => {
const limits = cursorUsageResponseToLimits(
{
diff --git a/packages/provider-cursor/src/server/usageLimits.ts b/packages/provider-cursor/src/server/usageLimits.ts
index 049e646d2c492..d6b6963ed72b1 100644
--- a/packages/provider-cursor/src/server/usageLimits.ts
+++ b/packages/provider-cursor/src/server/usageLimits.ts
@@ -32,6 +32,32 @@ const CursorUsageResponse = Schema.Struct({
),
});
+/**
+ * Limits use a dashboard access token, not an agent API key.
+ * Keep a configured CURSOR_AUTH_TOKEN; otherwise browser sign-in supplies the session.
+ * An explicit API key stays unsupported.
+ */
+export function cursorUsageLimitsEnvironment(
+ processEnv: NodeJS.ProcessEnv,
+ options: {
+ readonly apiKey: string | undefined;
+ readonly usesApiKey: boolean;
+ },
+): NodeJS.ProcessEnv {
+ if (options.usesApiKey) {
+ return { ...processEnv, CURSOR_API_KEY: options.apiKey };
+ }
+ return {
+ ...processEnv,
+ CURSOR_API_KEY: undefined,
+ ...(processEnv.CURSOR_AUTH_TOKEN?.trim()
+ ? {}
+ : options.apiKey
+ ? { CURSOR_AUTH_TOKEN: options.apiKey }
+ : {}),
+ };
+}
+
/** Cursor's dashboard percentages include bonus usage; spend / limit does not. */
export function cursorUsageResponseToLimits(
response: typeof CursorUsageResponse.Type,