OpenRouter

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 上安装 OpenRouter
OpenRouter · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

2 分钟设置

  1. 1在 cloud.anythingmcp.com 开始免费试用。
  2. 2在连接器商店点击 OpenRouter。提示时粘贴凭据。
  3. 3生成 MCP API 密钥,将 AI 客户端指向生成的 MCP URL。
立即安装 OpenRouter

OpenRouter 指南

面向主流 AI 客户端的逐步设置。

配置 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)

  1. Sign in at https://openrouter.ai and add credits under Settings, Credits (free :free models work without credits, within daily limits).
  2. 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.
  3. Paste the key (it starts with sk-or-v1-) into OPENROUTER_API_KEY. It is sent as Authorization: Bearer. Requests carry HTTP-Referer and X-OpenRouter-Title headers that name AnythingMCP as the calling app on OpenRouter.
  4. Run openrouter_get_current_key to check the key.

Workflow

  • Choose a model: openrouter_list_models (filters such as q, category, supported_parameters=tools, max_price, context, sort=pricing-low-to-high) or openrouter_list_user_models for the models this key may use under the account's privacy settings and guardrails. Then openrouter_get_model for one model's details, openrouter_list_model_endpoints for the providers that serve it with their prices, uptime, latency and throughput, and openrouter_list_providers for 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_completion with model and messages; models adds fallbacks, provider steers routing (order, only, sort by price or throughput, data_collection deny, zdr), response_format asks for JSON, reasoning sets the effort. openrouter_create_embeddings for vectors, openrouter_generate_image for images (returned as image content). These three spend credits: confirm with the user before repeated or large calls and set max_completion_tokens to cap a reply.
  • Spending: openrouter_get_current_key shows the key's limit, limit_remaining and usage today, this week, this month and in total. openrouter_get_generation gives the exact cost, tokens and provider of one call (its id is the id of the completion; it can take a few seconds to appear), openrouter_get_generation_content the stored prompt and output when prompt logging is on.

Reading the answers

  • Model ids are author/slug (openai/gpt-4o); split them for author and slug. 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); request and image are per request or per image. The max_price filters and the routing max_price take USD per million tokens. Costs and usage in key and generation answers are USD.
  • A completion returns choices[0].message.content, the finish_reason (stop, length when the token cap was hit, tool_calls, content_filter) and usage with token counts and cost. The provider field says who served it.
  • created is 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.

你的 AI 距离 OpenRouter 仅两次点击。

安装连接器、粘贴凭据、向 AI 提问。7 天免费,无需信用卡。