OpenRouter
OpenRouter, one API for hundreds of AI models: search the model catalog with prices, providers, benchmarks and rankings, check the key's spending, look up past generations, and send chat completions, embeddings and image requests to any model.
7 天免费 · 无需信用卡 · EU 托管
问 OpenRouter 任何事
通过 AnythingMCP 对 OpenRouter 试一个真实提示 — Claude 调用工具并返回答案。在你的消息上按 Enter 即可在 Cloud 安装。
在 Cloud 上安装 OpenRouterClaude 是 AI,可能会出错。请核对回答。
2 分钟设置
- 1在 cloud.anythingmcp.com 开始免费试用。
- 2在连接器商店点击 OpenRouter。提示时粘贴凭据。
- 3生成 MCP API 密钥,将 AI 客户端指向生成的 MCP URL。
配置 OpenRouter
直接来自连接器定义:在哪里获取凭据、需要哪些权限,以及该适配器调用的是哪个 API。 由连接器作者以英文提供。
OpenRouter
This connector uses the OpenRouter API (https://openrouter.ai/api/v1), one OpenAI-compatible endpoint in front of hundreds of models from OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek and others. It searches the model catalog, compares providers, prices and benchmarks, shows what the key has spent, looks up past generations, and sends chat completions, embeddings and image requests to any model.
Setup (2 minutes)
- Sign in at https://openrouter.ai and add credits under Settings, Credits (free
:freemodels work without credits, within daily limits). - Open Settings, API Keys (https://openrouter.ai/settings/keys), click Create Key, give it a name and, strongly recommended, a credit limit: the key can spend the account balance up to that limit.
- Paste the key (it starts with
sk-or-v1-) intoOPENROUTER_API_KEY. It is sent asAuthorization: Bearer. Requests carryHTTP-RefererandX-OpenRouter-Titleheaders that name AnythingMCP as the calling app on OpenRouter. - Run
openrouter_get_current_keyto check the key.
Workflow
- Choose a model:
openrouter_list_models(filters such asq,category,supported_parameters=tools,max_price,context,sort=pricing-low-to-high) oropenrouter_list_user_modelsfor the models this key may use under the account's privacy settings and guardrails. Thenopenrouter_get_modelfor one model's details,openrouter_list_model_endpointsfor the providers that serve it with their prices, uptime, latency and throughput, andopenrouter_list_providersfor provider slugs and data policies. - Compare quality and popularity:
openrouter_list_benchmarks(Artificial Analysis, Design Arena, OpenRouter evals),openrouter_get_model_rankings(top models by tokens per day, week or month). - Run a model:
openrouter_chat_completionwithmodelandmessages;modelsadds fallbacks,providersteers routing (order, only, sort by price or throughput, data_collection deny, zdr),response_formatasks for JSON,reasoningsets the effort.openrouter_create_embeddingsfor vectors,openrouter_generate_imagefor images (returned as image content). These three spend credits: confirm with the user before repeated or large calls and setmax_completion_tokensto cap a reply. - Spending:
openrouter_get_current_keyshows the key's limit,limit_remainingand usage today, this week, this month and in total.openrouter_get_generationgives the exact cost, tokens and provider of one call (itsidis theidof the completion; it can take a few seconds to appear),openrouter_get_generation_contentthe stored prompt and output when prompt logging is on.
Reading the answers
- Model ids are
author/slug(openai/gpt-4o); split them forauthorandslug. Variants::free(free, rate limited),:online(web search),:nitro(fastest provider),:floor(cheapest),:thinking. - Prices in the catalog are strings in USD per token (
"0.0000025"= 2.50 USD per million tokens);requestandimageare per request or per image. Themax_pricefilters and the routingmax_pricetake USD per million tokens. Costs and usage in key and generation answers are USD. - A completion returns
choices[0].message.content, thefinish_reason(stop,lengthwhen the token cap was hit,tool_calls,content_filter) andusagewith token counts andcost. Theproviderfield says who served it. createdis Unix seconds; dates are UTC.
Paging: the model list tools return 50 models by default; pass offset 50, 100, ... with the same limit until a page comes back shorter than limit. Prefer filters and sort over reading the whole catalog.
Limits: :free models allow 20 requests a minute and 50 a day (1,000 a day once 10 USD of credits were ever bought). Paid models are limited by the account balance, the key's credit limit and any budgets an organization admin set; openrouter_get_current_key shows them. Benchmarks allow 30 requests a minute per key.
Not included: credit balance of the whole account, activity reports, analytics and key management need a separate management key and are not part of this connector; streaming, the legacy text completions endpoint, batches, video and audio are not exposed either.
Errors: 401 invalid or disabled key; 402 not enough credits or the key's limit is used up (error.metadata.limit_source says which; add credits or raise the limit); 403 blocked by a guardrail or moderation; 404 unknown model or generation; 408 timeout; 429 rate limited (wait, or use a paid variant); 502 the model's provider failed; 503 no provider matches the routing requirements (relax provider). A provider error during generation can arrive with HTTP 200 and an error object; it is reported as a failed call.