openrouter-oauth — Claude Code skill: what it does, how to install
openrouter-oauth adds Sign In with OpenRouter to browser apps via OAuth PKCE without a backend, SDK, or client credentials.
no license 362 installs ★ 327 updated 2026-10-24
npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a claude-codeWhat openrouter-oauth does
This skill guides the agent in writing browser-only authentication code for OpenRouter. The user grants access on OpenRouter and your client app receives an API key. Everything relies on PKCE: random 32 bytes from the Web Crypto API turn into an S256 challenge, eliminating the need for client secrets.
The logic covers every step of the redirect round-trip: saving the one-time verifier to sessionStorage, verifying the returning code parameter, exchanging it at the OpenRouter keys endpoint, and stripping the query string with history.replaceState. It also sets up cross-tab synchronization with the storage event and supplies the brand SVG logo.
Without Web Crypto API and web storage in the environment, this implementation will fail.
What it helps with
- integrate OpenRouter sign-in without running an authentication backend
- generate PKCE verifiers and SHA-256 challenges directly in client JavaScript
- obtain an OpenRouter inference API key from a browser redirect flow
- sync OpenRouter session state across browser tabs via storage events
Example prompts for the agent
- Implement OpenRouter OAuth PKCE authentication for my single-page app
- Add a Sign In with OpenRouter button using the provided SVG mark
- Write a handler that takes the auth code from the URL and exchanges it for a key
How to install openrouter-oauth
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a claude-code2Manually: put the files in place
~/.claude/skills/openrouter-oauth/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/openrouter-oauth/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a codex2Manually: put the files in place
.agents/skills/openrouter-oauth/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a cursor2Manually: put the files in place
.cursor/skills/openrouter-oauth/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install OpenRouterTeam/skills skills/openrouter-oauth2Manually: put the files in place
.github/skills/openrouter-oauth/SKILL.md1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a gemini-cli2Platform CLI
gemini skills install https://github.com/OpenRouterTeam/skills --path skills/openrouter-oauthManually: put the files in place
.devin/skills/openrouter-oauth/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about openrouter-oauth
How to install openrouter-oauth in Claude Code?
Run npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a claude-code in your project terminal.
Does OpenRouter OAuth require app registration or a secret?
No client registration or secret is needed. Proof of identity rests entirely on the generated PKCE verifier.
What browser APIs are required?
The flow depends on the Web Crypto API for random values and hashing, plus sessionStorage and localStorage.