Token导航 LogoToken导航

Agent Skill · 研究检索

openrouter(OpenRouter 模型网关)

openrouter 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

openrouter 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 56,831。

总安装 445周安装 18GitHub Stars 公开资料未说明下载 140核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openrouter(OpenRouter 模型网关)
来源仓库:https://github.com/rawwerks/raygent-skills
仓库路径:skills/openrouter
安装命令:
npx skills add rawwerks/raygent-skills --skill "openrouter"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add rawwerks/raygent-skills --skill "openrouter"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

openrouter 用于在 Codex、Claude、Cursor、Gemini CLI 中查找和筛选信息。它适合根据关键词或任务场景快速定位候选结果,辅助 OpenRouter 模型网关相关工作。通过 npx skills add 命令安装,需结合原始 README 继续核验具体用法。

使用前建议确认权限范围和维护状态,避免不必要的联网或文件读写。openrouter 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/openrouter

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add rawwerks/raygent-skills --skill "openrouter";命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

openrouter 怎么安装?

在终端执行 npx skills add rawwerks/raygent-skills --skill "openrouter"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

openrouter 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

openrouter 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

openrouter 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

openrouter 用的人多吗?

公开数据是累计安装 445 次,近一周安装 18 次,下载 140 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

openrouter 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
openrouter

OpenRouter 模型网关 · 本页

445—接触敏感数据MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

OpenRouter

Overview

OpenRouter provides a unified API to access hundreds of LLM models from different providers (OpenAI, Anthropic, Google, Meta, and more) with automatic routing, cost tracking, and performance monitoring. Use this skill to make API calls to any OpenRouter model, compare responses across models, track costs and latency, and optimize model selection.

Quick Start

To call an OpenRouter model:

  1. Set OPENROUTER_API_KEY in your environment
  2. Use the scripts/call_openrouter.sh script with --model and --prompt flags
  3. Add --json flag for structured output

The script returns:

  • Response time in seconds (wall-clock time)
  • Cost in dollars (OpenRouter pricing)
  • Full response content
  • Token counts (prompt, completion, total)

Making API Calls

Basic Usage

The scripts/call_openrouter.sh script provides a flexible CLI interface:

# Basic call
bash scripts/call_openrouter.sh \
  --model "anthropic/claude-3.5-sonnet" \
  --prompt "Explain quantum computing" \
  --json

# With optional parameters
bash scripts/call_openrouter.sh \
  --model "openai/gpt-4o:nitro" \
  --prompt "Write a haiku" \
  --max-tokens 100 \
  --temperature 0.7 \
  --json

Command-Line Arguments

  • --model (required): Model ID (e.g., "anthropic/claude-3.5-sonnet")
  • --prompt (required): User prompt/question
  • --system: Optional system message
  • --max-tokens: Maximum tokens to generate
  • --temperature: Temperature (0.0-2.0)
  • --json: Output as JSON (default: human-readable)

Environment Variables

  • OPENROUTER_API_KEY (required): Your API key
  • OPENROUTER_REFERER (optional): HTTP referer for tracking (default: http://localhost)
  • OPENROUTER_TITLE (optional): Title for tracking (default: Local Test)
  • MODEL (optional): Override the default model

Reading the Output

The script outputs:

  1. Response time in seconds (measured client-side)
  2. Complete JSON response with:

- choices[0].message.content: The model's response - usage.prompt_tokens: Input token count - usage.completion_tokens: Output token count - usage.total_tokens: Total tokens used

Cost Calculation

To calculate costs:

  1. Get the model's pricing from the models list (see references)
  2. Calculate: (prompt_tokens × prompt_price) + (completion_tokens × completion_price)

Example: If a model costs $0.0000025/token for prompts and $0.000002/token for completions, and uses 14 prompt + 277 completion tokens:

  • Cost = (14 × 0.0000025) + (277 × 0.000002) = $0.000035 + $0.000554 = $0.000589

Model Selection

Finding Models

Retrieve the full models list with pricing and capabilities:

curl https://openrouter.ai/api/v1/models -H "Authorization: Bearer $OPENROUTER_API_KEY" > models.json

The list is sorted by creation date (newest first), serving as a proxy for quality.

Important: The models list can be very large. Consider saving to a file and using grep/jq to filter by:

  • Price range
  • Context length
  • Specific providers
  • Capabilities (vision, function calling, etc.)

Model Naming Format

OpenRouter uses provider/model-name:

  • anthropic/claude-3.5-sonnet
  • openai/gpt-4o
  • google/gemini-pro-1.5
  • meta-llama/llama-3.1-405b-instruct

Speed and Feature Modifiers

:nitro - Use the fastest available provider for a model

anthropic/claude-3.5-sonnet:nitro

:online - Enable web search capabilities

openai/gpt-4o:online

Combine modifiers:

anthropic/claude-3.5-sonnet:nitro:online

Common Use Cases

Testing a Specific Model

Edit the script's PAYLOAD to use the desired model and messages:

{
  "model": "anthropic/claude-3.5-sonnet",
  "messages": [
    {"role": "user", "content": "Explain quantum computing in simple terms"}
  ]
}

Comparing Models

Run the script multiple times with different models and compare:

  • Response quality
  • Response time
  • Token usage and cost

Finding the Cheapest/Fastest Model

  1. Fetch the models list and save to file
  2. Use jq or grep to filter by criteria
  3. Test top candidates with the script
  4. Compare performance vs. cost trade-offs

For speed: Try models with :nitro suffix For cost: Filter models.json by lowest pricing values

Accessing Provider Information (Non-API)

Opening Provider Pages with Query Parameters

While the OpenRouter API provides model information, provider-specific details like throughput, latency, and availability are only accessible via the web interface. You can programmatically open these pages with sorting parameters.

URL Structure
https://openrouter.ai/<model-slug>/providers?sort=<sorting-option>

Available Sorting Options:

  • throughput - Sort by provider throughput (tokens/sec)
  • price - Sort by cost
  • latency - Sort by response latency
Example: Opening Provider Page Sorted by Throughput

For the model moonshotai/kimi-k2-0905:

https://openrouter.ai/moonshotai/kimi-k2-0905/providers?sort=throughput
Use Case: Finding the Fastest Provider

When you need to identify which provider offers the best throughput for a specific model:

  1. Extract the model slug from the model ID (e.g., openai/gpt-4o → openai/gpt-4o)
  2. Construct the URL: https://openrouter.ai/<model-slug>/providers?sort=throughput
  3. Open the URL in a browser or use web automation tools
  4. The page will display providers sorted by throughput (highest first)

Note: This information is not available through the API and requires web interface access. The :nitro modifier automatically routes to the fastest provider, but if you need to see provider-specific metrics, use the web interface with query parameters.

Workflow for Agent Tools

If you have browser automation capabilities:

  • Use mcp__chrome-devtools__new_page or similar to open the provider page
  • The ?sort=throughput parameter ensures the page loads pre-sorted
  • Extract provider metrics from the rendered page

Accessing Model Rankings by Category

OpenRouter provides model rankings filtered by specific use cases and categories. These rankings show which models perform best for different tasks based on user ratings and token usage.

URL Structure
https://openrouter.ai/rankings?category=<category-value>#categories
Available Categories
Category Display NameQuery Parameter ValueExample URL
Programmingprogramminghttps://openrouter.ai/rankings?category=programming#categories
Roleplayroleplayhttps://openrouter.ai/rankings?category=roleplay#categories
Marketingmarketinghttps://openrouter.ai/rankings?category=marketing#categories
Marketing/Seomarketing/seohttps://openrouter.ai/rankings?category=marketing/seo#categories
Technologytechnologyhttps://openrouter.ai/rankings?category=technology#categories
Sciencesciencehttps://openrouter.ai/rankings?category=science#categories
Translationtranslationhttps://openrouter.ai/rankings?category=translation#categories
Legallegalhttps://openrouter.ai/rankings?category=legal#categories
Financefinancehttps://openrouter.ai/rankings?category=finance#categories
Healthhealthhttps://openrouter.ai/rankings?category=health#categories
Triviatriviahttps://openrouter.ai/rankings?category=trivia#categories
Academiaacademiahttps://openrouter.ai/rankings?category=academia#categories
Usage Notes
  • Most categories use lowercase versions of their names (e.g., programming, science)
  • The Marketing/Seo category uses marketing/seo with a slash
  • The #categories anchor is optional but helps navigate to the categories section
  • Rankings are not available through the API and require web interface access
  • Each category shows models ranked by performance for that specific use case
Use Case: Finding the Best Model for a Specific Task

When you need to identify top-performing models for a particular domain:

  1. Select the appropriate category from the table above
  2. Construct the URL: https://openrouter.ai/rankings?category=<value>#categories
  3. Open the URL in a browser or use web automation tools
  4. The page displays models ranked by performance for that category

Example for programming tasks:

https://openrouter.ai/rankings?category=programming#categories
Workflow for Agent Tools

If you have browser automation capabilities:

  • Use mcp__chrome-devtools__new_page to open the rankings page
  • The ?category=<value> parameter loads the page with the selected category
  • Verify the category dropdown shows the expected category name
  • Extract model rankings and performance data from the rendered page

Resources

scripts/call_openrouter.sh

Bash script that makes an API call to OpenRouter and returns timing, cost, and full response. Uses curl and jq for simple, dependency-free execution.

Requirements: jq (for JSON parsing)

Usage:

bash call_openrouter.sh --model "anthropic/claude-3.5-sonnet" --prompt "Your question" --json

references/models_and_features.md

Detailed reference on:

  • How to fetch and filter the models list
  • Model naming conventions
  • Speed (:nitro) and web search (:online) modifiers
  • Cost calculation from usage data

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

平台分布

Claude Code

24.52%
按下载量换算34

windsurf

23.72%
按下载量换算33

trae

18.93%
按下载量换算27

OpenCode

11.93%
按下载量换算17

Codex

7.04%
按下载量换算10

Antigravity

3.62%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills