Skip to content
Tất cả bài

Publish website do ChatGPT tạo bằng AnyRouter Artifacts

ChatGPT viết HTML. AnyRouter Artifacts lưu trang đó tại một URL ổn định. Publish từ chat qua MCP hoặc từ terminal bằng anyr. Mặc định là riêng tư.

Từ prompt tới URL

Nhờ ChatGPT viết một file index.html tự chứa. Lưu file vào một thư mục, publish thư mục bằng CLI anyr, rồi chép URL mà lệnh in ra. Trang mặc định ở chế độ riêng tư cho đến khi bạn đổi 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.

Yêu cầu một file có thể render

Trang artifact chạy trong một frame bị cô lập. Trang có thể tải các file khác trong cùng phiên bản, nhưng không gọi URL khác. Trang phụ thuộc script CDN hoặc font từ xa sẽ bị hỏng giao diện.

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.

Nếu câu trả lời gồm nhiều file, hãy lưu từng file vào cùng một thư mục. Entry index.html được mở trước. Nếu thư mục có hai entry hợp lệ, hãy đặt entry_path tới file bạn muốn.

Publish từ terminal

Cài CLI, đăng nhập, rồi publish thư mục. CLI in ra URL và số phiên bản.

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"
}

Để thay trang sau này, gửi thư mục mới tới cùng một id. Người đã có link sẽ thấy phiên bản mới nhất.

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

CLI bỏ qua dotfile và node_modules khi publish thư mục. Một file đơn được tải lên dạng văn bản UTF-8, nên hãy đưa ảnh nhị phân vào thư mục.

Publish từ ChatGPT qua MCP

Nếu ChatGPT đã cài plugin AnyRouter với gói quyền Standard, nó có thể gọi publish_artifact mà không cần terminal. Công cụ nhận bản đồ đường dẫn tới nội dung văn bản, phù hợp cho một file HTML hoặc một cặp HTML và CSS nhỏ.

Bắt đầu với hướng dẫn connector ChatGPT. Sau đó yêu cầu publish bằng ngôn ngữ tự nhiên.

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.

Công cụ giới hạn 1 MB văn bản và không nhận ảnh. Với site có tài sản nhị phân, hãy dùng luồng thư mục REST. Luồng này gửi manifest kèm kích thước và SHA-256, tải các file còn thiếu, rồi commit.

Chia sẻ, kiểm tra và dọn dẹp

Đổi visibility bằng một yêu cầu PATCH. Dashboard có cùng các điều khiển trong mục 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.

Việc cần làm tiếp

Publish một trang, gửi link cho một người, rồi publish phiên bản hai tới cùng một id. Đó là toàn bộ vòng lặp. Bài giới thiệu Artifacts mô tả các loại khác, gồm Markdown, sơ đồ Mermaid, bảng tính và component React.

Manage your pages in the dashboard.

Open Artifacts

Câu hỏi thường gặp

Link có giữ nguyên khi tôi sửa trang không?

Có. Publish lại cùng một artifact id sẽ thêm một phiên bản có số thứ tự tại cùng URL. Gửi `base_version` theo phiên bản bạn đang xây, hoặc dùng `--id` với CLI anyr. Nếu có người publish trước, bạn nhận 409 để gộp trước khi thử lại.

Có cần tên miền hoặc tài khoản hosting không?

Không. URL nằm trên anyrouter.dev. Bạn cần tài khoản AnyRouter cùng một key hoặc CLI đã đăng nhập. Artifact unlisted ai có link cũng mở được, nhưng không nằm trong gallery và không được công cụ tìm kiếm lập chỉ mục.

Có publish được site React không?

Có. Một entry `.tsx` hoặc `.jsx` duy nhất với default export sẽ render trong trình duyệt. Entry tối đa 256 KB và chỉ import được một danh sách thư viện cố định. Với site có ảnh hoặc nhiều file, hãy dùng luồng manifest qua REST.

Bài liên quan

Chọn gói và bắt đầu ngay

Go: $2/tháng, $4 credit.

Pro: $10/tháng, $20 credit.

Pro+: $45/tháng, $100 credit.

Max: $100/tháng, $300 credit.

Tạo tài khoản, thanh toán ở màn hình sau, rồi gọi model.