Use only normal API keys for OpenRouter spend #8

Merged
raucao merged 1 commits from bugfix/openrouter_key into master 2026-11-16 18:30:58 +00:00
Owner

OpenRouter now rejects management keys from the browser on both the key-listing and analytics endpoints, so the management-key flow can no longer work in the extension. The widget now reads the configured key's own usage from GET /api/v1/key, which returns UTC daily, weekly, and monthly buckets and works from the browser.

This removes the key-type selection, key listing/selection, pagination, and the management/analytics endpoints. The key is validated against /api/v1/key before saving, and the stored record is built fresh so legacy keyType/keyIds fields are dropped. The browser-block hint is kept for anyone still storing a management key.

Verified with pnpm lint and pnpm test (502 passing).

OpenRouter now rejects management keys from the browser on both the key-listing and analytics endpoints, so the management-key flow can no longer work in the extension. The widget now reads the configured key's own usage from `GET /api/v1/key`, which returns UTC daily, weekly, and monthly buckets and works from the browser. This removes the key-type selection, key listing/selection, pagination, and the management/analytics endpoints. The key is validated against `/api/v1/key` before saving, and the stored record is built fresh so legacy `keyType`/`keyIds` fields are dropped. The browser-block hint is kept for anyone still storing a management key. Verified with `pnpm lint` and `pnpm test` (502 passing).
raucao added 1 commit 2026-11-16 18:16:44 +00:00
OpenRouter now rejects management keys from the browser on both
/api/v1/keys and /api/v1/analytics/query, so the management-key flow can
no longer work in the extension. Read the configured key's own usage from
GET /api/v1/key instead, which returns UTC daily, weekly, and monthly
buckets and works from the browser.

Drop the key-type selection, key listing/selection, pagination, and the
management/analytics endpoints. Validate the key against /key before
persisting, and write a fresh record so legacy keyType/keyIds fields are
dropped. Keep the browser-block hint for anyone still storing a
management key.
Author
Owner

(Background is that OpenRouter started blocking management keys used from browser runtimes.)

(Background is that OpenRouter started blocking management keys used from browser runtimes.)
raucao merged commit b0cfd635ce into master 2026-11-16 18:30:58 +00:00
raucao deleted branch bugfix/openrouter_key 2026-11-16 18:30:58 +00:00
Sign in to join this conversation.