Skip to content
全部文章

AnyRouter + ChatGPT:用 MCP 插件连接

ChatGPT 无法更换自己的模型服务商。把 AnyRouter 添加为自定义 MCP 插件,就能在对话里查看模型、查询额度并发布页面。

今天可行的做法

ChatGPT 无法更换自己在对话中使用的模型。自定义 MCP 插件是受支持的桥梁。把 AnyRouter 添加为远程 MCP 服务,ChatGPT 就能在对话中调用我们的工具。

服务地址是 https://anyrouter.dev/api/v1/mcp。请在网页端添加。ChatGPT 通过 HTTPS 连接远程服务,支持 SSE 和流式 HTTP。本地 stdio 服务无法连接。

  • There is no chat tool on the AnyRouter MCP server. Model calls go to /api/v1/chat/completions, /api/v1/messages or /api/v1/responses.
  • ChatGPT's custom MCP plugin dialog offers OAuth and no authentication. It does not offer a static bearer token field as of 22 November 2026. AnyRouter supports OAuth with dynamic client registration and PKCE, so the web flow is the one to use.
  • The Read-only permission bundle is the default. It includes list_models, recommend_model, artifact reads and credit reads. Standard adds the write tools, including publish_artifact.
  • Write tools ask for confirmation before they run. Read-only tools carry a hint that clients use to skip the prompt.

工具列表刻意保持简短。list_models 会返回每个模型的 access 和 can_route 标记,对话就能判断哪些模型当前可路由,而不是依赖过期列表猜测。recommend_model 按价格或上下文过滤为某个任务排序。两个工具都不发起模型调用,因此不消耗推理额度。

限流也有文档。每个 credential 每分钟最多调用 120 次工具,每个 IP 在认证前每分钟最多 300 次请求。MCP 使用管理层限流,而非推理限流。工具陷入循环时会收到带重试提示的 429。

OpenAI 的自定义 MCP 服务指南说明 ChatGPT 一侧的设置。AnyRouter MCP 参考文档列出全部工具和权限。两者均于 2026 年 11 月 22 日查阅。

添加连接器

在浏览器中打开 ChatGPT Plugins,然后添加自定义 MCP 服务。

  1. 1

    打开添加对话框. 点击加号,再选择 Add custom MCP server。菜单文字可能变化,若你的工作区使用新版布局,请寻找添加自定义服务的入口。

  2. 2

    填写服务信息. 名称填 AnyRouter。服务器地址填 https://anyrouter.dev/api/v1/mcp。对话框若要求描述,写一行即可。

  3. 3

    选择 OAuth. 在认证方式中选择 OAuth。阅读风险提示后点击 Create as a plugin。如果 ChatGPT 要求安装插件,请确认安装。

  4. 4

    批准权限. 第一次调用会打开 anyrouter.dev/oauth/consent。登录后选择 Read-only 或 Standard,再点击允许。只有需要在聊天中发布 artifact 或管理密钥时才选 Standard。

  5. 5

    在对话中调用. 在输入框键入 @,选择 AnyRouter,然后提出点名工具的提问。例如 Use AnyRouter's list_models tool to show free models that can route today.

好用的提示词

ChatGPT 根据请求挑选工具。点名工具可以消除大部分歧义。下面的提示词只用服务器上真实存在的工具。

AskToolBundle
Which models can you route for me right now?list_modelsRead-only
Recommend a cheap model for translation.recommend_modelRead-only
How much credit is left in this workspace?get_creditsRead-only
Show my artifacts.list_artifactsRead-only
Publish this HTML as an unlisted artifact.publish_artifactStandard

具体的提示词比宽泛的更可靠。当两个应用有相似工具时,写明服务标签和工具名。OpenAI 指南也推荐这种做法。

A prompt that names the server and the tool
@AnyRouter Use the list_models tool with free_only set to true.
Show only models that can_route is true. Return a short table.

连接器无法连接时

大多数失败原因都很短。

  • Use ChatGPT on the web. The custom server flow is a web feature, and workspace rules can hide it.
  • Open https://anyrouter.dev/.well-known/oauth-authorization-server in a browser. A JSON document with authorization_endpoint and registration_endpoint means discovery is reachable.
  • If tools do not appear, start a new chat and select the plugin with @. Check the app settings page for a refresh action that pulls new tools.
  • On a work or school account, ask the admin whether connectors are enabled. Workspace permissions apply to custom MCP servers.
  • For a headless or local integration, skip the plugin. Use a bearer key from Dashboard, Keys in a client that supports token auth.

在 Claude Code 中可用的 token 不能修好 ChatGPT 的对话框。两种客户端提供的认证方式不同。

从聊天中发布内容

安装插件并授予 Standard 权限后,可以让 ChatGPT 生成一个自包含的 HTML 页面,再用 publish_artifact 发布。该工具接受路径到文本内容的映射,所以一个 index.html 是最简单的情况。

网站发布指南覆盖完整流程,包括带图片目录的 CLI 方案。

Turn a chat-generated page into a shareable link.

Read the guide

常见问题

能在 ChatGPT 应用里通过 AnyRouter 调用 GPT 模型吗?

不能。ChatGPT 应用使用自己的模型。AnyRouter 是 API 网关。要通过 AnyRouter 发送模型请求,请使用 API、playground 或编程智能体。MCP 插件只给 ChatGPT 提供工具,不会替换聊天模型。

连接插件会产生费用吗?

建立连接本身不收费。工具调用遵循 MCP 限流规则。你通过 AnyRouter API 发出的模型调用遵循正常的额度和 BYOK 规则。

ChatGPT 能发布 artifact 吗?

可以。批准连接器时选择 Standard 权限包,其中包含 publish_artifact 所需的 write:artifacts 权限。该工具接受总计不超过 1 MB 的文本文件。图片或较大的目录请使用 REST 上传流程或 anyr CLI。

相关文章

选一个套餐,马上开始

Go 每月 $2,得 $4 额度。

Pro 每月 $10,得 $20 额度。

Pro+ 每月 $45,得 $100 额度。

Max 每月 $100,得 $300 额度。

注册后在下一页付款,即可调用模型。