openrouter-ai-models-guide
БесплатноБез исполняемых скриптовНе проверенGuide to OpenRouter — the unified API for 200+ AI models from OpenAI, Anthropic, Google, Meta, Mistral, and more. Covers model selection, pricing, routing…
от nirholas★ 289 звёзд на GitHubОб этом скилле
OpenRouter AI Models Guide
OpenRouter provides a unified API for 200+ AI models. This guide covers model selection, pricing, routing, and integration with SperaxOS.
What Is OpenRouter?
A single API endpoint that routes requests to 200+ models:
Your App → OpenRouter API → Model Provider
├── OpenAI (GPT-4, o1, o3)
├── Anthropic (Claude 4, Sonnet, Haiku)
├── Google (Gemini 2.5, Pro, Flash)
├── Meta (Llama 4, Maverick)
├── Mistral (Large, Medium)
├── DeepSeek (V3, R1)
└── 50+ more providers
Quick Start
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4-20250514",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Model Selection Guide
By Task
| Task | Recommended Model | Why |
|---|---|---|
| Complex reasoning | claude-sonnet-4, o3 | Best logical reasoning |
| Coding | claude-sonnet-4, deepseek-v3 | Best code generation |
| Creative writing | claude-sonnet-4, gpt-4o | Most creative output |
| Fast responses | gemini-flash, claude-haiku | Lowest latency |
| Long context | gemini-pro-2.5 (1M), claude-sonnet-4 (200K) | Largest context windows |
| DeFi analysis | claude-sonnet-4, gpt-4o | Best structured data handling |
| Vision/images | gpt-4o, gemini-pro | Best image understanding |
| JSON output | claude-sonnet-4, gpt-4o | Most reliable structured output |
| Budget | deepseek-v3, llama-4 | Cheapest per token |
By Price (per 1M tokens)
| Tier | Input | Output | Models |
|---|---|---|---|
| Free | $0 | $0 | Selected models with limits |
| Budget | $0.10-0.50 | $0.30-1.50 | DeepSeek, Llama, Gemma |
| Standard | $1-5 | $3-15 | GPT-4o, Claude Sonnet, Gemini Pro |
| Premium | $10-15 | $30-60 | o3, Claude Opus |
By Context Window
| Model | Context | Best For |
|---|---|---|
| Gemini 2.5 Pro | 1,048,576 | Entire codebases |
| Claude Sonnet 4 | 200,000 | Long documents |
| GPT-4o | 128,000 | Standard tasks |
| DeepSeek V3 | 64,000 | Budget long-context |
Routing Strategies
Automatic Routing
Let OpenRouter pick the best model:
{
"model": "openrouter/auto",
"messages": [...]
}
Fallback Chain
Define fallback models if primary is unavailable:
{
"model": "anthropic/claude-sonnet-4-20250514",
"route": "fallback",
"models": [
"anthropic/claude-sonnet-4-20250514",
"openai/gpt-4o",
"google/gemini-2.5-pro"
]
}
Cheapest Route
Use the cheapest available model for a task:
{
"model": "openrouter/cheapest",
"max_price": { "prompt": 0.001, "completion": 0.003 }
}
SperaxOS Integration
SperaxOS uses OpenRouter as a model provider:
Configuration
# .env
OPENROUTER_API_KEY=sk-or-...
OPENROUTER_MODEL_LIST=anthropic/claude-sonnet-4-20250514,openai/gpt-4o,google/gemini-2.5-pro
Model Data File
SperaxOS maintains a curated model list at data/openrouter-models.ts:
- Pre-selected models optimized for DeFi/crypto tasks
- Pricing and capability metadata
- Context window sizes
- Feature flags (vision, function calling, JSON mode)
Per-Agent Model Selection
Different SperaxOS agents can use different models:
- DeFi Advisor: Claude Sonnet 4 (best reasoning)
- Quick Chat: Gemini Flash (fastest response)
- Code Assistant: DeepSeek V3 (budget coding)
- Research Agent: Gemini 2.5 Pro (largest context)
API Compatibility
OpenRouter is compatible with:
- OpenAI SDK (just change base URL)
- LangChain
- LlamaIndex
- Vercel AI SDK
- Any OpenAI-compatible client
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://openrouter.ai/api/v1',
apiKey: process.env.OPENROUTER_API_KEY,
});
Links
- Website: https://openrouter.ai
- Docs: https://openrouter.ai/docs
- Models: https://openrouter.ai/models
- GitHub: https://github.com/nirholas/openrouter-models
- SperaxOS: https://app.sperax.io
Установить openrouter-ai-models-guide в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл openrouter-ai-models-guide?
Guide to OpenRouter — the unified API for 200+ AI models from OpenAI, Anthropic, Google, Meta, Mistral, and more. Covers model selection, pricing, routing strategies, fallback chains, and integration with SperaxOS for optimal model usage per task.
Как установить скилл openrouter-ai-models-guide?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл openrouter-ai-models-guide запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic