Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OpenRouterTeam/skills --skill openrouter-oauth -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/openrouter-oauth/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/openrouter-oauth/

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.

Similar skills

All skills for Frontend and UI →

From the same set16

The whole set →
openrouter-video The openrouter-video skill creates videos from prompts and can animate supplied images through OpenRouter. Use it when generation can run as an asynchronous job. CX Codex +1 388installs openrouter-analytics openrouter-analytics inspects OpenRouter costs, token counts, and latency through natural-language prompts. Useful when auditing API bills or finding expensive models. CX Codex +1 385installs openrouter-generations openrouter-generations is a Claude Code skill for inspecting OpenRouter requests by generation ID. It shows token costs, latency, provider routing, and saved prompts. CX Codex +1 383installs openrouter-agent-migration openrouter-agent-migration walks you through switching agent imports from @openrouter/sdk to the @openrouter/agent package. CX Codex +1 383installs create-agent-tui create-agent-tui is a Claude Code skill that generates a TypeScript agent with terminal UI, tools, and sessions for building an agent from scratch or adding a terminal interface. CX Codex +1 358installs openrouter-analytics-schema Fetches live OpenRouter analytics schema details, including metrics, dimensions, and filter rules. Useful when constructing usage or cost queries. CX Codex +1 355installs openrouter-analytics-query openrouter-analytics-query — a skill for building and running queries against the OpenRouter analytics API. Use it to pull metrics on model usage, group results by dimensions, and filter by time, model, or other parameters. CX Codex +1 355installs openrouter-tts openrouter-tts synthesizes speech audio from text using OpenRouter's speech API. Generates voiceovers, audiobook snippets, and audio files right from your prompt. CX Codex +1 327installs

Project sponsors

Companies that keep this analytics open