Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 71
  • 330 stars
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-oauth

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install openrouter-oauth in Claude Code

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

A

No 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 →

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.

openrouter-oauth Install

Add to stack

Loading.