openrouter-models

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenRouter Models

OpenRouter 模型

Discover, search, and compare the 300+ AI models available on OpenRouter. Query live data including pricing, context lengths, per-provider latency and uptime, throughput, supported modalities, and supported parameters.
探索、搜索并对比OpenRouter上可用的300+款AI模型。查询实时数据,包括定价、上下文长度、各服务商的延迟与正常运行时间、吞吐量、支持的模态以及支持的参数。

Prerequisites

前置条件

The
OPENROUTER_API_KEY
environment variable is optional for most scripts. It is only required for
get-endpoints.ts
(provider performance data). Get a key at https://openrouter.ai/keys
OPENROUTER_API_KEY
环境变量对于大多数脚本来说是可选的。仅在使用
get-endpoints.ts
(获取服务商性能数据)时需要。可在https://openrouter.ai/keys获取密钥。

First-Time Setup

首次设置

bash
cd <skill-path>/scripts && npm install
bash
cd <skill-path>/scripts && npm install

Decision Tree

决策树

Pick the right script based on what the user is asking:
User wants to...ScriptExample
See all available models
list-models.ts
"What models does OpenRouter have?"
Find recently added models
list-models.ts --sort newest
"What are the newest models?"
Find cheapest models
list-models.ts --sort price
"What's the cheapest model?"
Find highest throughput models
list-models.ts --sort throughput
"Which models have the most output capacity?"
Find models in a category
list-models.ts --category X
"Best programming models?"
Search by name
search-models.ts "query"
"Do they have Claude?"
Resolve an informal model name
resolve-model.ts "query"
"Use the nano banana 2.0 model"
Find image-capable models
search-models.ts --modality image
"Which models accept images?"
Compare specific models
compare-models.ts A B
"Compare Claude vs GPT-4o"
Compare by throughput
compare-models.ts A B --sort throughput
"Which has higher throughput, Claude or GPT-4o?"
Check provider performance
get-endpoints.ts "model-id"
"Which provider is fastest for Claude?"
Find fastest provider
get-endpoints.ts "model-id" --sort throughput
"Fastest provider for Claude Sonnet?"
Find lowest-latency provider
get-endpoints.ts "model-id" --sort latency
"Lowest latency provider for GPT-4o?"
Check model availability
get-endpoints.ts "model-id"
"Is Claude Sonnet 4 up right now?"
根据用户的需求选择合适的脚本:
用户需求脚本示例
查看所有可用模型
list-models.ts
"OpenRouter有哪些模型?"
查找最近新增的模型
list-models.ts --sort newest
"最新的模型有哪些?"
查找最便宜的模型
list-models.ts --sort price
"最便宜的模型是什么?"
查找吞吐量最高的模型
list-models.ts --sort throughput
"哪些模型的输出能力最强?"
查找特定类别的模型
list-models.ts --category X
"最佳编程模型有哪些?"
按名称搜索模型
search-models.ts "query"
"他们有Claude吗?"
解析非正式的模型名称
resolve-model.ts "query"
"使用nano banana 2.0模型"
查找支持图像的模型
search-models.ts --modality image
"哪些模型支持输入图像?"
对比特定模型
compare-models.ts A B
"对比Claude和GPT-4o"
按吞吐量对比模型
compare-models.ts A B --sort throughput
"Claude和GPT-4o哪个吞吐量更高?"
查看服务商性能
get-endpoints.ts "model-id"
"哪个服务商提供的Claude速度最快?"
查找最快的服务商
get-endpoints.ts "model-id" --sort throughput
"Claude Sonnet的最快服务商是哪个?"
查找延迟最低的服务商
get-endpoints.ts "model-id" --sort latency
"GPT-4o的最低延迟服务商是哪个?"
检查模型可用性
get-endpoints.ts "model-id"
"Claude Sonnet 4现在可用吗?"

Resolve Model

解析模型

Resolve an informal or vague model name to an exact OpenRouter model ID using fuzzy matching:
bash
cd <skill-path>/scripts && npx tsx resolve-model.ts "claude sonnet"
cd <skill-path>/scripts && npx tsx resolve-model.ts "gpt 4o mini"
cd <skill-path>/scripts && npx tsx resolve-model.ts "llama 3.1"
Results include a
confidence
level and
score
:
ConfidenceScoreAction
high
(≥0.85)
Use the model directly — the match is unambiguous
medium
(≥0.55)
Confirm with the user before proceeding
low
(≥0.30)
Suggest the matches and ask the user to clarify
Two-step workflow: First resolve the informal name with
resolve-model.ts
, then feed the resolved
id
into other scripts (
compare-models.ts
,
get-endpoints.ts
, etc.).
使用模糊匹配将非正式或模糊的模型名称解析为精确的OpenRouter模型ID:
bash
cd <skill-path>/scripts && npx tsx resolve-model.ts "claude sonnet"
cd <skill-path>/scripts && npx tsx resolve-model.ts "gpt 4o mini"
cd <skill-path>/scripts && npx tsx resolve-model.ts "llama 3.1"
结果包含
confidence
(置信度)和
score
(匹配分数):
置信度分数操作
high
(≥0.85)
直接使用该模型——匹配结果明确
medium
(≥0.55)
先与用户确认后再继续
low
(≥0.30)
给出匹配建议并请用户澄清
两步工作流: 首先使用
resolve-model.ts
解析非正式名称,然后将解析后的
id
输入到其他脚本(如
compare-models.ts
get-endpoints.ts
等)中。

List Models

列出模型

bash
cd <skill-path>/scripts && npx tsx list-models.ts
bash
cd <skill-path>/scripts && npx tsx list-models.ts

Filter by Category

按类别筛选

Server-side category filtering:
bash
cd <skill-path>/scripts && npx tsx list-models.ts --category programming
Categories:
programming
,
roleplay
,
marketing
,
marketing/seo
,
technology
,
science
,
translation
,
legal
,
finance
,
health
,
trivia
,
academia
服务端类别筛选:
bash
cd <skill-path>/scripts && npx tsx list-models.ts --category programming
可选类别:
programming
roleplay
marketing
marketing/seo
technology
science
translation
legal
finance
health
trivia
academia

Sort Results

排序结果

bash
cd <skill-path>/scripts && npx tsx list-models.ts --sort newest      # Recently added first
cd <skill-path>/scripts && npx tsx list-models.ts --sort price       # Cheapest first
cd <skill-path>/scripts && npx tsx list-models.ts --sort context     # Largest context first
cd <skill-path>/scripts && npx tsx list-models.ts --sort throughput  # Most output tokens first
Models with upcoming
expiration_date
values trigger a stderr warning.
bash
cd <skill-path>/scripts && npx tsx list-models.ts --sort newest      # 按新增时间排序(最新优先)
cd <skill-path>/scripts && npx tsx list-models.ts --sort price       # 按价格排序(最便宜优先)
cd <skill-path>/scripts && npx tsx list-models.ts --sort context     # 按上下文长度排序(最长优先)
cd <skill-path>/scripts && npx tsx list-models.ts --sort throughput  # 按吞吐量排序(输出令牌数最多优先)
带有即将到来的
expiration_date
的模型会触发stderr警告。

Search Models

搜索模型

bash
cd <skill-path>/scripts && npx tsx search-models.ts "claude"
cd <skill-path>/scripts && npx tsx search-models.ts --modality image
cd <skill-path>/scripts && npx tsx search-models.ts "gpt" --modality text
Modalities:
text
,
image
,
audio
,
file
bash
cd <skill-path>/scripts && npx tsx search-models.ts "claude"
cd <skill-path>/scripts && npx tsx search-models.ts --modality image
cd <skill-path>/scripts && npx tsx search-models.ts "gpt" --modality text
支持的模态:
text
image
audio
file

Compare Models

对比模型

Compare two or more models side-by-side with pricing in per-million-tokens format. Uses exact ID matching —
openai/gpt-4o
matches only that model, not variants like
gpt-4o-mini
.
bash
cd <skill-path>/scripts && npx tsx compare-models.ts "anthropic/claude-sonnet-4" "openai/gpt-4o"
cd <skill-path>/scripts && npx tsx compare-models.ts "anthropic/claude-sonnet-4" "openai/gpt-4o" "google/gemini-2.5-pro" --sort price
Sort options:
price
(cheapest first),
context
(largest first),
speed
/
throughput
(most output tokens first)
以每百万令牌的价格格式并排对比两款或多款模型。使用精确ID匹配——
openai/gpt-4o
仅匹配该模型,不包括
gpt-4o-mini
等变体。
bash
cd <skill-path>/scripts && npx tsx compare-models.ts "anthropic/claude-sonnet-4" "openai/gpt-4o"
cd <skill-path>/scripts && npx tsx compare-models.ts "anthropic/claude-sonnet-4" "openai/gpt-4o" "google/gemini-2.5-pro" --sort price
排序选项:
price
(最便宜优先)、
context
(最长优先)、
speed
/
throughput
(输出令牌数最多优先)

Provider Performance (Endpoints)

服务商性能(端点)

Get per-provider latency, uptime, and throughput for any model:
bash
cd <skill-path>/scripts && npx tsx get-endpoints.ts "anthropic/claude-sonnet-4"
cd <skill-path>/scripts && npx tsx get-endpoints.ts "anthropic/claude-sonnet-4" --sort throughput
cd <skill-path>/scripts && npx tsx get-endpoints.ts "openai/gpt-4o" --sort latency
Sort options:
throughput
(fastest tokens/sec first),
latency
(lowest p50 ms first),
uptime
(most reliable first),
price
(cheapest first)
Returns for each provider:
  • Latency (p50/p75/p90/p99 in ms) — median to worst-case response times
  • Throughput (p50/p75/p90/p99 tokens/sec) — generation speed
  • Uptime — percentage over the last 30 minutes
  • Status
    operational
    or
    degraded
  • Provider-specific pricing — some providers offer discounts
  • Supported parameters — varies by provider (some don't support all features)
获取任意模型的各服务商延迟、正常运行时间和吞吐量数据:
bash
cd <skill-path>/scripts && npx tsx get-endpoints.ts "anthropic/claude-sonnet-4"
cd <skill-path>/scripts && npx tsx get-endpoints.ts "anthropic/claude-sonnet-4" --sort throughput
cd <skill-path>/scripts && npx tsx get-endpoints.ts "openai/gpt-4o" --sort latency
排序选项:
throughput
(令牌/秒最快优先)、
latency
(p50毫秒最低优先)、
uptime
(最可靠优先)、
price
(最便宜优先)
返回每个服务商的以下信息:
  • 延迟(p50/p75/p90/p99,单位毫秒)——中位数到最坏情况的响应时间
  • 吞吐量(p50/p75/p90/p99,单位令牌/秒)——生成速度
  • 正常运行时间——过去30分钟内的可用百分比
  • 状态——
    operational
    (正常运行)或
    degraded
    (性能下降)
  • 服务商特定定价——部分服务商提供折扣
  • 支持的参数——因服务商而异(部分不支持所有功能)

API Response Shapes

API响应结构

GET /api/v1/models
returns
{ data: Model[] }
. For full field reference, see the Models reference.
Query parameters (all optional):
ParameterExampleEffect
category
?category=programming
Server-side category filter
supported_parameters
?supported_parameters=tools
Only models supporting this parameter
Tips for working with the response:
  • To check if a model supports a feature, use
    model.supported_parameters
    (e.g.
    .includes("tools")
    ), or filter server-side with
    ?supported_parameters=tools
    .
  • To check modalities, use
    model.architecture.input_modalities
    /
    model.architecture.output_modalities
    .
  • Pricing values are per-token in USD as strings — multiply by 1,000,000 for per-million-token pricing.
  • knowledge_cutoff
    and
    expiration_date
    are date strings or null.
  • links.details
    points to the per-provider endpoints API for that model.
    GET /api/v1/models/{author}/{slug}/endpoints
    returns
    { data: { id, name, endpoints: Endpoint[] } }
    .
  • Endpoint
    status
    :
    0
    = operational, non-zero = degraded.
  • Endpoint
    latency_last_30m
    /
    throughput_last_30m
    : percentile objects with
    p50
    ,
    p75
    ,
    p90
    ,
    p99
    .
GET /api/v1/models
返回
{ data: Model[] }
。完整字段参考请查看模型参考文档
查询参数(均为可选):
参数示例作用
category
?category=programming
服务端类别筛选
supported_parameters
?supported_parameters=tools
仅返回支持该参数的模型
处理响应的提示:
  • 要检查模型是否支持某功能,可使用
    model.supported_parameters
    (例如
    .includes("tools")
    ),或通过服务端参数
    ?supported_parameters=tools
    进行筛选。
  • 要检查模态,可使用
    model.architecture.input_modalities
    /
    model.architecture.output_modalities
  • 定价值为美元每令牌的字符串格式——乘以1,000,000即可得到每百万令牌的价格。
  • knowledge_cutoff
    expiration_date
    为日期字符串或null。
  • links.details
    指向该模型的各服务商端点API。
    GET /api/v1/models/{author}/{slug}/endpoints
    返回
    { data: { id, name, endpoints: Endpoint[] } }
  • 端点
    status
    0
    =正常运行,非0=性能下降。
  • 端点
    latency_last_30m
    /
    throughput_last_30m
    :包含
    p50
    p75
    p90
    p99
    的百分位数对象。

Script Output Formats

脚本输出格式

The scripts below reformat the raw API data. When calling the API directly (e.g. via
fetch
), refer to the OpenAPI spec for field names.
以下脚本会重新格式化原始API数据。直接调用API(例如通过
fetch
)时,请参考OpenAPI规范获取字段名称。

list-models.ts / search-models.ts

list-models.ts / search-models.ts

A subset of the raw API fields — the scripts run
formatModel()
which drops
canonical_slug
,
hugging_face_id
,
default_parameters
,
knowledge_cutoff
, and
links
. If you need those fields, call the API directly.
原始API字段的子集——脚本会运行
formatModel()
,去除
canonical_slug
hugging_face_id
default_parameters
knowledge_cutoff
links
字段。如果需要这些字段,请直接调用API。

compare-models.ts

compare-models.ts

json
{
  "id": "anthropic/claude-sonnet-4",
  "name": "Anthropic: Claude Sonnet 4",
  "context_length": 1000000,
  "max_completion_tokens": 64000,
  "per_request_limits": null,
  "pricing_per_million_tokens": {
    "prompt": "$3.00",
    "completion": "$15.00",
    "cached_input": "$0.30"
  },
  "modalities": { "input": ["text", "image"], "output": ["text"] },
  "supported_parameters": ["max_tokens", "temperature", "..."],
  "is_moderated": false
}
json
{
  "id": "anthropic/claude-sonnet-4",
  "name": "Anthropic: Claude Sonnet 4",
  "context_length": 1000000,
  "max_completion_tokens": 64000,
  "per_request_limits": null,
  "pricing_per_million_tokens": {
    "prompt": "$3.00",
    "completion": "$15.00",
    "cached_input": "$0.30"
  },
  "modalities": { "input": ["text", "image"], "output": ["text"] },
  "supported_parameters": ["max_tokens", "temperature", "..."],
  "is_moderated": false
}

get-endpoints.ts

get-endpoints.ts

json
{
  "model_id": "anthropic/claude-sonnet-4",
  "model_name": "Anthropic: Claude Sonnet 4",
  "total_providers": 5,
  "endpoints": [
    {
      "provider": "Anthropic",
      "tag": "anthropic",
      "status": "operational",
      "uptime_30m": "100.00%",
      "latency_30m_ms": { "p50": 800, "p75": 1200, "p90": 2000, "p99": 5000 },
      "throughput_30m_tokens_per_sec": { "p50": 45, "p75": 55, "p90": 65, "p99": 90 },
      "context_length": 1000000,
      "max_completion_tokens": 64000,
      "pricing_per_million_tokens": { "prompt": "$3.00", "completion": "$15.00", "cached_input": "$0.30" },
      "supports_implicit_caching": true,
      "supported_parameters": ["max_tokens", "temperature", "tools", "..."]
    }
  ]
}
json
{
  "model_id": "anthropic/claude-sonnet-4",
  "model_name": "Anthropic: Claude Sonnet 4",
  "total_providers": 5,
  "endpoints": [
    {
      "provider": "Anthropic",
      "tag": "anthropic",
      "status": "operational",
      "uptime_30m": "100.00%",
      "latency_30m_ms": { "p50": 800, "p75": 1200, "p90": 2000, "p99": 5000 },
      "throughput_30m_tokens_per_sec": { "p50": 45, "p75": 55, "p90": 65, "p99": 90 },
      "context_length": 1000000,
      "max_completion_tokens": 64000,
      "pricing_per_million_tokens": { "prompt": "$3.00", "completion": "$15.00", "cached_input": "$0.30" },
      "supports_implicit_caching": true,
      "supported_parameters": ["max_tokens", "temperature", "tools", "..."]
    }
  ]
}

Key Fields

关键字段

FieldMeaning
pricing.prompt
/
pricing.completion
Cost per token in USD. Multiply by 1,000,000 for per-million-token pricing
context_length
Max total tokens (input + output)
top_provider.max_completion_tokens
Max output tokens from the best provider
top_provider.is_moderated
Whether content moderation is applied
per_request_limits
Per-request token limits (when non-null)
supported_parameters
API parameters the model accepts (e.g.,
tools
,
structured_outputs
,
reasoning
,
web_search_options
)
created
Unix timestamp — use for sorting by recency
expiration_date
Non-null means the model is being deprecated
latency_30m_ms.p50
Median response latency over last 30 min
throughput_30m_tokens_per_sec.p50
Median generation speed over last 30 min
uptime_30m
Provider availability percentage over last 30 min
字段含义
pricing.prompt
/
pricing.completion
每令牌的美元成本。乘以1,000,000可得到每百万令牌的价格
context_length
最大总令牌数(输入+输出)
top_provider.max_completion_tokens
最佳服务商支持的最大输出令牌数
top_provider.is_moderated
是否应用内容审核
per_request_limits
每请求令牌限制(非null时有效)
supported_parameters
模型接受的API参数(例如
tools
structured_outputs
reasoning
web_search_options
created
Unix时间戳——用于按新增时间排序
expiration_date
非null表示该模型即将被弃用
latency_30m_ms.p50
过去30分钟内的中位数响应延迟
throughput_30m_tokens_per_sec.p50
过去30分钟内的中位数生成速度
uptime_30m
过去30分钟内服务商的可用百分比

Presenting Results

结果展示建议

  • When a user mentions a model by informal name, use
    resolve-model.ts
    first, then feed the resolved
    id
    into other scripts
  • Convert pricing to per-million-tokens format for readability
  • When comparing, use a markdown table with models as columns
  • For provider endpoints, highlight the fastest (lowest p50 latency) and most reliable (highest uptime) providers
  • Call out notable supported parameters:
    tools
    ,
    structured_outputs
    ,
    reasoning
    ,
    web_search_options
  • Note cache pricing when available — it can cut input costs 90%+
  • Flag models with
    expiration_date
    as deprecated
  • When a model has multiple providers at different prices, mention the cheapest option
  • 当用户提及非正式的模型名称时,先使用
    resolve-model.ts
    解析,再将解析后的
    id
    输入到其他脚本中
  • 将定价转换为每百万令牌的格式以提升可读性
  • 对比模型时,使用markdown表格,将模型作为列展示
  • 对于服务商端点,突出显示最快(p50延迟最低)和最可靠(正常运行时间最高)的服务商
  • 标注值得关注的支持参数:
    tools
    structured_outputs
    reasoning
    web_search_options
  • 若有缓存定价,请注意说明——它可将输入成本降低90%以上
  • 标记带有
    expiration_date
    的模型为即将弃用
  • 当某一模型有多个不同定价的服务商时,提及最便宜的选项