Skip to content
全部文章

用 AnyRouter Artifacts 发布 ChatGPT 生成的网站

ChatGPT 写 HTML,AnyRouter Artifacts 把它托管在一个稳定地址。可以在聊天里用 MCP 发布,也可以在终端用 anyr 发布。默认私密。

从提示到网址

让 ChatGPT 写一个自包含的 index.html。把文件存进目录,用 anyr CLI 发布目录,复制命令输出的网址。页面默认私密,直到你修改 visibility。

  • The link has the shape https://anyrouter.dev/a/<id>. It stays the same across versions.
  • Every artifact starts private. Use unlisted for a link you send to one person, and public only when you want the gallery and search engines to see it.
  • An account can hold 100 artifacts and 200 MB in current versions, with 20 publishes per hour.
  • A folder publish accepts up to 50 files and 20 MB in the CLI. A single inline REST publish accepts 10 MB. The MCP publish_artifact tool takes 1 MB of text.
  • An account can make artifacts public 24 hours after sign-up, up to 5 a day. These limits and the file types are in the Artifacts API reference, read on 22 November 2026.

要求一份能真正渲染的文件

artifact 页面运行在沙箱 frame 中。它能读取同一版本里的其他文件,但不能请求外部网址。依赖 CDN 脚本或远程字体的页面会显示异常。

A prompt that produces one publishable file
Write a single self-contained index.html for a small project dashboard.
Put all CSS in a style tag and all JavaScript in a script tag.
Use inline SVG for icons. Do not load fonts, images or scripts from other URLs.
Use system fonts. Return only the file contents.

如果回答包含多个文件,把它们存到同一目录。index.html 入口会优先打开。若目录里有两个候选入口,请用 entry_path 指定。

从终端发布

安装 CLI,登录,然后发布目录。CLI 会输出网址和版本号。

terminal
curl -fsSL https://anyr.dev/cli.sh | bash
anyr auth login
anyr artifact publish ./my-site --title "Weekend build" --visibility unlisted --json
The reply carries the stable id
{
  "id": "k3Vx9TqLm2Ab7Zcd",
  "version": 1,
  "url": "https://anyrouter.dev/a/k3Vx9TqLm2Ab7Zcd",
  "visibility": "unlisted"
}

之后要替换页面,把新目录发布到同一个 id。已经拿到链接的人会看到最新版本。

terminal
anyr artifact publish ./my-site --id k3Vx9TqLm2Ab7Zcd --label "fix hero"

CLI 发布目录时会跳过点文件和 node_modules。单个文件按 UTF-8 文本上传,所以二进制图片请放进目录。

在 ChatGPT 中通过 MCP 发布

如果 ChatGPT 已安装 AnyRouter 插件并授予 Standard 权限,它无需终端就能调用 publish_artifact。该工具接收路径到文本内容的映射,适合一个 HTML 文件或一份小型 HTML 与 CSS 组合。

先阅读 ChatGPT 连接器指南,然后用自然语言提出发布请求。

Name the tool so the chat does not reach for another app
@AnyRouter Use publish_artifact with title "Weekend build" and visibility unlisted.
Files: index.html set to the complete HTML you just wrote.
Return the URL from the reply.

该工具限制 1 MB 文本且不能携带图片。带二进制资源的站点请使用 REST 目录流程。流程会发送带大小和 SHA-256 的 manifest,上传缺失文件,再提交。

分享、检查与清理

用一次 PATCH 请求就能修改 visibility。Dashboard 的 Artifacts 页面提供相同控件。

VisibilityWho can open itGallerySearch engines
privateOnly youNoNo
unlistedAnyone with the URLNoNo
publicAnyone with the URLYesYes
  • Your name stays off the page unless you set show_author. Email is never shown.
  • The owner view reports daily views and visitors without storing an IP address.
  • A private id answers 404 to everyone else, so the id is not a discovery path.
  • Deleting an artifact stops its URL immediately. Do it only when you mean to.

A failed publish is usually one of four cases. entry_ambiguous means set entry_path. 413 means the inline body is too large, so use a folder. 403 account_too_new means use unlisted for now. A blank page usually means the HTML called an external URL that the sandbox blocks.

下一步

发布一个页面,把链接发给一个人,再向同一个 id 发布第二个版本。整个流程就是这样。Artifacts 发布公告介绍其他类型,包括 Markdown、Mermaid 图、表格和 React 组件。

Manage your pages in the dashboard.

Open Artifacts

常见问题

修改页面后链接会变吗?

不会。向同一个 artifact id 再次发布,会在同一地址新增一个带编号的版本。带上你所基于版本的 `base_version`,或在 anyr CLI 中使用 `--id`。若有人先发布,会返回 409,合并后再重试。

需要域名或托管账号吗?

不需要。地址在 anyrouter.dev 上。你需要 AnyRouter 账号,以及密钥或已登录的 CLI。unlisted artifact 只要有链接就能打开,但不会出现在画廊,也不会被搜索引擎收录。

能发布 React 站点吗?

可以。单个带默认导出的 `.tsx` 或 `.jsx` 入口会在浏览器中渲染。入口最大 256 KB,且只能导入指定库列表。带图片或多文件的站点请使用 REST manifest 流程。

相关文章

选一个套餐,马上开始

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

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

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

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

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