Skip to content
Back to skills

Openrouter Install Auth

BSecurity

Execute set up OpenRouter API authentication and configure API keys. Use when starting a new OpenRouter integration or troubleshooting auth issues. Trigger with phrases like 'openrouter setup', 'openrouter api key', 'openrouter authentication', 'configure openrouter'.

  • 4 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 10, 2026
securitypythonshellnodeapidocumentation

Works with

  • cli
  • api

Security analysis

B84/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 4 files and shows the line behind each finding

Scanned September 10, 2026

npx -y skills add micsapp/micstec-skills --skill openrouter-install-auth --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openrouter Install Auth?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openrouter Install Auth
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/micsapp-openrouter-install-auth/badge)](https://www.skillsdirectory.com/skills/micsapp-openrouter-install-auth)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: openrouter-install-auth
description: |
  Execute set up OpenRouter API authentication and configure API keys. Use when starting a new OpenRouter integration or troubleshooting auth issues. Trigger with phrases like 'openrouter setup', 'openrouter api key', 'openrouter authentication', 'configure openrouter'.
allowed-tools: Read, Write, Edit, Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
compatible-with: claude-code, codex, openclaw
---
# Openrouter Install Auth

## Overview

This skill guides you through obtaining and configuring OpenRouter API credentials, setting up environment variables, and verifying your authentication is working correctly.

## Prerequisites

- OpenRouter account (free at openrouter.ai)
- Python 3.8+ or Node.js 18+
- OpenAI SDK installed (`pip install openai` or `npm install openai`)

## Instructions

1. **Create an OpenRouter account**: Sign up at [openrouter.ai](https://openrouter.ai) and navigate to the API Keys page
2. **Generate an API key**: Click "Create Key", give it a descriptive name, and copy the `sk-or-...` value immediately (it won't be shown again)
3. **Configure your environment**: Add `OPENROUTER_API_KEY=sk-or-...` to your `.env` file or export it in your shell profile
4. **Initialize the OpenAI SDK**: Point the SDK at `base_url="https://openrouter.ai/api/v1"` with your key
5. **Verify authentication**: Run a minimal chat completion request and confirm you get a 200 response with valid output

## Output

- A working OpenAI SDK client configured for OpenRouter
- Environment variable set and loadable from `.env`
- Successful test request confirming authentication works

## Error Handling

| Error | Cause | Fix |
|-------|-------|-----|
| 401 `invalid_api_key` | Key is malformed or revoked | Regenerate at openrouter.ai/keys |
| 401 `missing_api_key` | Authorization header missing | Add `Authorization: Bearer sk-or-...` header |
| 403 `insufficient_credits` | Account has no credits | Add credits at openrouter.ai/credits or use a free model |

See `${CLAUDE_SKILL_DIR}/references/errors.md` for full error reference.

## Examples

See `${CLAUDE_SKILL_DIR}/references/examples.md` for runnable code samples.

## Resources

- [OpenRouter Documentation](https://openrouter.ai/docs)
- [OpenRouter Models](https://openrouter.ai/models)
- [OpenRouter API Reference](https://openrouter.ai/docs/api-reference)
- [OpenRouter Status](https://status.openrouter.ai)

Files in this skill

  • SKILL.md2.4 KB
  • references/environment-setup.md710 B
  • references/errors.md323 B
  • references/examples.md2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.