跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 OpenRouter,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
OpenRouter 用一个 API 接入数百个 AI 模型:搜索带价格、提供商、基准和排行的模型目录,查看密钥支出,查询历史生成记录,并向任意模型发送聊天补全、嵌入和图像请求。
试试这样问
OpenRouter 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → OpenRouter、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
OpenRouter
OpenRouter 用一个 API 接入数百个 AI 模型:搜索带价格、提供商、基准和排行的模型目录,查看密钥支出,查询历史生成记录,并向任意模型发送聊天补全、嵌入和图像请求。
设置
设置大约需要 2 分钟。你需要一个 OpenRouter 账户。
- 登录 https://openrouter.ai,在 Settings, Credits 中充值额度。免费的
:free模型无需额度即可使用,但有每日限制。 - 打开 Settings, API Keys(https://openrouter.ai/settings/keys),点击 Create Key,填写名称,并强烈建议设置 credit limit:该密钥最多可以花掉这个上限内的账户余额。
- 把以
sk-or-v1-开头的密钥粘贴到OPENROUTER_API_KEY。它以Authorization: Bearer发送。管理密钥(management key)在这里不可用。请求会带上HTTP-Referer和X-OpenRouter-Title请求头,在 OpenRouter 上标明调用方应用为 AnythingMCP。 - 安装连接器并运行
openrouter_get_current_key检查密钥。
可读取的内容(免费):
- 用
openrouter_list_models查询模型目录:模型 ID、上下文长度、价格、输入输出模态、支持的参数和 reasoning 支持,可用q、category、supported_parameters=tools、max_price、context等筛选,并在服务端排序,例如sort=pricing-low-to-high。openrouter_list_user_models显示在账户的提供商偏好、隐私设置和护栏规则下,这个密钥实际可用的模型。 - 用
openrouter_get_model查看单个模型,用openrouter_list_model_endpoints查看提供该模型的各提供商端点(价格、上下文和输出上限、量化、状态,以及最近 30 分钟的可用率、延迟和吞吐量),用openrouter_list_providers查看提供商 slug、总部、数据中心所在国家和政策链接。 - 质量和热度:
openrouter_list_benchmarks(Artificial Analysis、Design Arena 和 OpenRouter 自己的评测)以及openrouter_get_model_rankings(按每日、每周或每月 token 量排名前 50 的模型,数据始于 2025-01-01)。 - 支出:
openrouter_get_current_key显示密钥上限、limit_remaining、今天、本周、本月和累计用量、预算以及免费层状态。openrouter_get_generation给出单次调用的准确费用、token 数、延迟和提供商(其 ID 就是补全的id,可能要几秒后才出现),openrouter_get_generation_content在开启提示词日志时返回保存的提示词和输出。
会产生费用的工具:openrouter_chat_completion(传入 model 和 messages;models 添加备选模型,provider 按顺序、only、价格或吞吐量、data_collection: deny 或 zdr 控制路由,response_format 要求 JSON,reasoning 设置推理强度)、openrouter_create_embeddings 和 openrouter_generate_image(以图像内容返回)。除非使用 :free 模型,否则都会向账户计费。所有工具在安装时都已开启,所以 AI 会在较大或重复的调用前确认模型和用途,并设置 max_completion_tokens 限制回复长度。
数据格式:模型 ID 形如 author/slug(openai/gpt-4o),变体有 :free(免费,有速率限制)、:online(联网搜索)、:nitro(最快的提供商)、:floor(最便宜)和 :thinking。目录价格是以每 token 美元计的字符串("0.0000025" 即每百万 token 2.50 美元);request 和 image 按每次请求或每张图片计价。max_price 筛选和路由中的 max_price 以每百万 token 美元计。密钥和生成记录响应中的费用和用量都是美元。补全返回 choices[0].message.content、finish_reason(stop、达到 token 上限时为 length、tool_calls、content_filter)、含 token 数和 cost 的 usage,以及 provider。created 为 Unix 秒,日期为 UTC。
翻页:模型列表工具默认返回 50 个模型;AI 用相同的 limit 依次传入 offset 50、100 等,直到某页变短为止,并优先使用筛选和 sort,而不是读取整个目录。
限制::free 模型每分钟 20 次、每天 50 次请求;只要曾经累计购买过 10 美元额度,就变为每天 1,000 次。付费模型受账户余额、密钥的 credit limit 和组织管理员设定的预算限制。基准接口每个密钥每分钟 30 次请求。
常见错误:401 表示密钥无效或已停用。402 表示额度不足或密钥上限已用完(error.metadata.limit_source 会说明是哪一个;请充值或提高上限)。403 是被护栏或审核拦截,404 是模型或生成记录不存在,408 是超时,429 是速率限制(稍等,或改用付费变体),502 是模型提供商出错,503 是没有提供商满足路由要求(放宽 provider)。生成过程中的提供商错误可能以 HTTP 200 加 error 对象返回,会被报告为调用失败。
该连接器不显示整个账户的额度余额、活动报告或分析,也不管理密钥,因为这些需要单独的管理密钥。流式输出、旧版文本补全端点、批处理、视频和音频同样不提供。
前提条件: OPENROUTER_API_KEY
本地安装连接器
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
打开 http://localhost:3000/connectors/store,选择 OpenRouter 并填入前提条件中列出的环境变量。
可用工具
| Tool | What it does |
|---|---|
openrouter_list_models | Search the OpenRouter model catalog (public, no cost): model ids, context length, prices per token, input and output modalities, supported… |
openrouter_list_user_models | List the models this API key may actually use, after the account's provider preferences, privacy settings and guardrails are applied |
openrouter_get_model | Full details of one model by author and slug (openai/gpt-4o): description, context length, pricing, modalities, supported and default… |
openrouter_list_model_endpoints | List the provider endpoints that serve one model: provider name and tag, price per token, context and output limits, quantization… |
openrouter_list_providers | List the inference providers OpenRouter routes to, with slug, name, headquarters, datacenter countries and links to their privacy policy… |
openrouter_list_benchmarks | Benchmark scores of models from Artificial Analysis (intelligence, coding and agentic indices), Design Arena (ELO) and OpenRouter's own… |
openrouter_get_model_rankings | Public OpenRouter usage rankings: the top 50 models by tokens processed per day, week or month, plus one aggregated other row per period… |
openrouter_get_current_key | Spending and limits of the API key in use: label, credit limit and what remains of it, reset interval, usage today, this week, this month… |
openrouter_get_generation | Cost and metadata of one past generation by its id: model, provider that served it, total cost in USD, prompt, completion and reasoning… |
openrouter_get_generation_content | The stored prompt, completion, reasoning and error of one past generation by its id |
openrouter_chat_completion | Send a conversation to a model and return its reply (non-streaming) |
openrouter_create_embeddings | Turn one text or a list of texts into embedding vectors with an embeddings model |
openrouter_generate_image | Generate images from a text prompt with an image model and return them as images |
示例提示
- “哪些支持工具调用、上下文至少 128K 的模型,每百万输入 token 低于 1 美元?”
- “按价格、可用率和吞吐量比较提供 deepseek/deepseek-chat 的各家提供商。”
- “这个 API 密钥本月花了多少?上限还剩多少?”
- “让 google/gemini-2.5-flash 用五个要点总结这段文字,输出最多 500 token。”
- “本周按 token 量排名前 10 的是哪些模型?它们在编程基准上的得分如何?”
下一步
这份指南对你有帮助吗?