Skip to content

BYO OpenRouter key on review page#13

Open
dangng2004 wants to merge 2 commits into
mainfrom
wip/byo-openrouter-key
Open

BYO OpenRouter key on review page#13
dangng2004 wants to merge 2 commits into
mainfrom
wip/byo-openrouter-key

Conversation

@dangng2004
Copy link
Copy Markdown
Contributor

@dangng2004 dangng2004 commented May 13, 2026

Summary

  • New always-visible BYO OpenRouter key panel on the upload page.
  • Copy explains the shared daily budget and asks users with their own keys to use them so more budget remains for users without keys.
  • Password input; key is sent as the `openrouter_api_key` form field and never stored client-side.
  • `BACKEND_URL` auto-detects localhost (so the same page works against a local uvicorn on port 8080 during dev) and otherwise points at the prod Cloud Run URL.

Paired backend PR

Requires the matching backend change to actually consume the key and skip rate-limiting: ChicagoHAI/openaireview-web-backend (WIP PR opened alongside this one).

Test plan

  • Submit without a key — existing rate-limited path
  • Submit with an invalid key — backend rejects with friendly error
  • Submit with a valid key — review runs against user's key; rate limit not consumed

Adds a prominent always-visible section on /review.html where users can
paste a personal OpenRouter key. When supplied, the backend uses it for
the review and bypasses the shared daily limit, leaving more of the
shared budget for less well-resourced users.

- New BYO key panel between the help text and the email field, on
  brand (accent-light bg + accent border) so it reads as a first-class
  option rather than a hidden tweak.
- Password input; key is sent as the `openrouter_api_key` form field
  and never persisted in the page.
- Backend URL auto-detects localhost vs production so the same page
  works against a local uvicorn (port 8080) during development.
@dangng2004
Copy link
Copy Markdown
Contributor Author

dangng2004 commented May 13, 2026

image

@dangng2004 dangng2004 marked this pull request as ready for review May 13, 2026 01:49
@dangng2004 dangng2004 changed the title WIP: BYO OpenRouter key on review page BYO OpenRouter key on review page May 13, 2026
Headline now leads with the concrete benefit (review the full paper,
not just the first 20 pages) and keeps the "leave more budget for less
well-resourced users" framing as the secondary reason.

Adds a Length dropdown inside the BYOK box with two options:
  * 20k tokens (~20 pages) — default
  * Full paper (up to 100 pages)

The selection is sent as the `tier` form field; the backend only
honors it when a BYO key is also supplied.
Comment thread review.html
<div id="byok-section" style="border:1.5px solid #f9c0c0;border-radius:var(--radius-sm);background:var(--accent-light);margin-top:50px;margin-bottom:14px;padding:16px;box-shadow:var(--shadow-sm);">
<div style="font-size:14px;font-weight:700;color:var(--accent);margin-bottom:8px;letter-spacing:-0.1px;">Use your own key to review full papers</div>
<div style="font-size:13px;color:var(--text);line-height:1.55;margin-bottom:12px;">
By default, submissions are capped at 20 pages / 20k tokens to protect a shared daily budget. With your own OpenRouter key you can review the full paper, and you also leave more of the shared budget for less well-resourced users. Your key is used only for this single review and is never stored or logged. Get one at <a href="https://openrouter.ai/keys" target="_blank">openrouter.ai/keys</a>.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too simple. Maybe add

"We encourage you to provide an OpenRouter API key so you can review the full paper without the default 20-page / 20k-token submission cap. These limits exist to make a free service possible (reach out if you are interested in sponsoring our research). Using your own key also helps reserve our free service budget for less well-resourced users. Your key is used only for this single review and is never stored or logged. Get one at openrouter.ai/keys."

Copy link
Copy Markdown
Contributor

@chenhaot chenhaot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take a look at my wording?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants