skills/openrouter/SKILL.md
OpenRouter API - Unified access to 400+ AI models through one API
npx skillsauth add alexdcd/mafia-claude-skills openrouterInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive assistance with OpenRouter API development, providing unified access to hundreds of AI models through a single endpoint with intelligent routing, automatic fallbacks, and standardized interfaces.
This skill should be triggered when:
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="<OPENROUTER_API_KEY>",
)
completion = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "What is the meaning of life?"}]
)
print(completion.choices[0].message.content)
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://openrouter.ai/api/v1',
apiKey: '<OPENROUTER_API_KEY>',
});
const completion = await openai.chat.completions.create({
model: 'openai/gpt-4o',
messages: [{"role": 'user', "content": 'What is the meaning of life?'}],
});
console.log(completion.choices[0].message);
curl https://openrouter.ai/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "What is the meaning of life?"}]
}'
completion = client.chat.completions.create(
model="openai/gpt-4o",
extra_body={
"models": ["anthropic/claude-3.5-sonnet", "gryphe/mythomax-l2-13b"],
},
messages=[{"role": "user", "content": "Your prompt here"}]
)
const completion = await client.chat.completions.create({
model: 'openai/gpt-4o',
models: ['anthropic/claude-3.5-sonnet', 'gryphe/mythomax-l2-13b'],
messages: [{ role: 'user', content: 'Your prompt here' }],
});
completion = client.chat.completions.create(
model="openrouter/auto", # Automatically selects best model for the prompt
messages=[{"role": "user", "content": "Your prompt here"}]
)
completion = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Write a creative story"}],
temperature=0.8, # Higher for creativity (0.0-2.0)
max_tokens=500, # Limit response length
top_p=0.9, # Nucleus sampling (0.0-1.0)
frequency_penalty=0.5, # Reduce repetition (-2.0-2.0)
presence_penalty=0.3 # Encourage topic diversity (-2.0-2.0)
)
stream = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end='')
completion = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{
"role": "user",
"content": "Extract person's name, age, and city from: John is 30 and lives in NYC"
}],
response_format={"type": "json_object"}
)
completion = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Generate a random number"}],
seed=42, # Same seed = same output (when supported)
temperature=0.0 # Deterministic sampling
)
OpenRouter provides intelligent routing capabilities:
openrouter/auto): Automatically selects the best model based on your prompt using NotDiamondModels use the format provider/model-name:
openai/gpt-4o - OpenAI's GPT-4 Optimizedanthropic/claude-3.5-sonnet - Anthropic's Claude 3.5 Sonnetgoogle/gemini-2.0-flash-exp:free - Google's free Gemini modelopenrouter/auto - Auto-routing systemTemperature (0.0-2.0, default: 1.0)
Top P (0.0-1.0, default: 1.0)
Frequency/Presence Penalties (-2.0-2.0, default: 0.0)
Max Tokens (integer)
stream: trueresponse_format: {"type": "json_object"}This skill includes comprehensive documentation in references/:
Use view to read specific reference files when detailed model information is needed.
openai/gpt-4o or anthropic/claude-3.5-sonnetopenrouter/auto for automatic model selectiontry:
completion = client.chat.completions.create(
model="openai/gpt-4o",
extra_body={
"models": [
"anthropic/claude-3.5-sonnet",
"google/gemini-2.0-flash-exp:free"
]
},
messages=[{"role": "user", "content": "Your prompt"}]
)
except Exception as e:
print(f"All models failed: {e}")
# Use cheaper models for simple tasks
simple_completion = client.chat.completions.create(
model="google/gemini-2.0-flash-exp:free",
messages=[{"role": "user", "content": "Simple question"}]
)
# Use premium models for complex tasks
complex_completion = client.chat.completions.create(
model="openai/o1",
messages=[{"role": "user", "content": "Complex reasoning task"}]
)
# Low temperature for factual responses
factual = client.chat.completions.create(
model="openai/gpt-4o",
temperature=0.2,
messages=[{"role": "user", "content": "What is the capital of France?"}]
)
# High temperature for creative content
creative = client.chat.completions.create(
model="openai/gpt-4o",
temperature=1.2,
messages=[{"role": "user", "content": "Write a unique story opening"}]
)
POST https://openrouter.ai/api/v1/chat/completionsGET https://openrouter.ai/api/v1/modelsGET https://openrouter.ai/api/v1/generationtools
Auditoría defensiva para repositorios AI-native. Usar SIEMPRE que el usuario quiera revisar un repo antes de lanzar, mergear, actualizar dependencias, migrar package manager, configurar un agente IA, MCP, Claude/Cursor/Codex/OpenClaw, o cuando mencione supply chain, prompt injection, secretos, GitHub Actions, npm/pnpm, paquetes maliciosos, scripts peligrosos, o riesgos de seguridad en repos con IA. Activar también si el usuario dice "revisa el repo", "está seguro esto", "antes de producción", "audita el PR" o cualquier variación.
development
Use when given a detailed implementation plan from a frontier AI to execute inside OpenCode with non-frontier coding models. Validates the plan against the real repository, breaks it into safe steps, verifies each step, inspects diffs, and prevents destructive changes. Triggers on: receiving a multi-step plan from Claude Opus/GPT-5/etc., executing a pre-written spec, implementing a detailed PR description, or being told to "execute this plan step by step."
development
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
tools
Generates optimized prompts for any AI tool. Use when writing, fixing, improving, or adapting a prompt for LLM, Cursor, Midjourney, image AI, video AI, coding agents, or any other AI tool.