openrouter-install-auth

Featured

Set up OpenRouter API authentication and configure API keys. Use when starting a new OpenRouter integration, rotating keys, or troubleshooting auth issues. Triggers: 'openrouter setup', 'openrouter api key', 'configure openrouter auth', 'sk-or key'.

API & Backend 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# OpenRouter Install & Auth ## Overview Set up OpenRouter API credentials, configure the OpenAI-compatible client, verify authentication, and check credit balance. OpenRouter keys start with `sk-or-v1-` and authenticate against `https://openrouter.ai/api/v1`. ## Prerequisites - OpenRouter account (free at [openrouter.ai](https://openrouter.ai)) - Python 3.8+ or Node.js 18+ - OpenAI SDK (`pip install openai` or `npm install openai`) ## Quick Setup ### 1. Generate an API Key 1. Go to [openrouter.ai/keys](https://openrouter.ai/keys) 2. Click **Create Key**, name it (e.g., `my-app-dev`) 3. Copy the `sk-or-v1-...` value immediately (shown only once) 4. Optionally set a credit limit on the key for spend control ### 2. Configure Environment ```bash # .env file (add .env to .gitignore!) OPENROUTER_API_KEY=sk-or-v1-your-key-here # Or export directly export OPENROUTER_API_KEY="sk-or-v1-your-key-here" ``` ### 3. Initialize the Client **Python:** ```python from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"], default_headers={ "HTTP-Referer": "https://your-app.com", # For analytics attribution "X-Title": "Your App Name", # Shows in dashboard }, ) ``` **TypeScript:** ```typescript import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://openrouter.ai/api/v1", apiKey: process.env.OPENROUTER_API_KEY, defaultHeaders: { "HTTP-Referer...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category