openrouter-oauth
Skill by OpenRouterTeam
Adds Sign In with OpenRouter to a web app using OAuth PKCE. Users authorize on OpenRouter and the app receives an API key, with no client registration, backend or secrets. Built for browser-based apps in any framework.
Install openrouter-oauth
Built from the published package, never by AI.
git clone --depth 1 https://github.com/OpenRouterTeam/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/skills/openrouter-oauth ~/.claude/skills/openrouter-oauthRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/OpenRouterTeam/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/skills/openrouter-oauth ~/.gemini/antigravity-cli/skills/openrouter-oauthAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
Sign In with OpenRouter is a skill that helps an AI assistant add OAuth login to a web app. Users authorize on OpenRouter, and the app receives an API key. It uses the OAuth PKCE flow, so no client registration, backend or secrets are needed. The source says it works with any framework.
The skill covers the full flow: generating a code verifier and challenge, redirecting to OpenRouter, handling the callback, and exchanging the code for a key at the auth keys endpoint. It also includes a drop-in TypeScript auth module, a sign-in button with Tailwind variants, and an example call to the Responses API using the key. It is aimed at developers building browser-based apps that need OpenRouter login or API keys for model inference.
Written from the project's SKILL.md and checked against it.
What it can do
- PKCE login flowGenerates a code verifier and challenge, then redirects the user to OpenRouter to authorize.
- Callback handlingChecks for a pending OAuth flow and reads the code returned to the app after sign-in.
- Key exchangeExchanges the returned code and verifier for an OpenRouter API key.
- Auth moduleProvides a drop-in TypeScript module for storing the key and syncing sign-in state across tabs.
- Sign-in buttonBuilds a button with the OpenRouter logo, several variants, sizes and a loading state.
- API key usageShows how to call the OpenRouter Responses API with the returned key as a Bearer token.
What you need
- An OpenRouter account to authorize sign-in
- A browser with Web Crypto API, localStorage and sessionStorage
Try asking
- Add a Sign in with OpenRouter button to my React app
- Set up OpenRouter OAuth PKCE login for my browser app
- Exchange the OAuth code for an OpenRouter API key and store it
Good to know
- Targets browser-based apps only (compatibility: browser)
- Requires Web Crypto API, localStorage and sessionStorage
- SDK usage such as callModel is covered by a separate skill, openrouter-typescript-sdk
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/openrouter-oauth/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to openrouter-oauth
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
openrouter-oauth: common questions
Does Sign In with OpenRouter need a client ID or secret?
No. The source says no client ID or secret is needed, because the PKCE challenge is the only proof of identity.
Where is the code verifier stored?
In sessionStorage rather than localStorage, so it does not persist after the tab closes or leak to other tabs.
Where is the API key stored after sign-in?
The source says the key is stored in localStorage, and storage events keep other tabs updated when the user signs in or out.
How do I install openrouter-oauth?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is openrouter-oauth free?
The code is public, but no licence file was found, so check the repository before commercial use.
Is openrouter-oauth safe to use?
It scores 71 of 100. Grades: maintenance A, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to openrouter-oauth?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
