# 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ư.

- Date: November 22, 2026
- Category: guides
- HTML: https://anyrouter.dev/blog/vi/publish-chatgpt-website-artifacts

## 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](https://anyrouter.dev/docs/api-reference/artifacts), 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.

```text
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.
```

_A prompt that produces one publishable file._

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.

```bash
curl -fsSL https://anyr.dev/cli.sh | bash
anyr auth login
anyr artifact publish ./my-site --title "Weekend build" --visibility unlisted --json
```

```json
{
  "id": "k3Vx9TqLm2Ab7Zcd",
  "version": 1,
  "url": "https://anyrouter.dev/a/k3Vx9TqLm2Ab7Zcd",
  "visibility": "unlisted"
}
```

_The reply carries the stable id._

Để 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.

```bash
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](https://anyrouter.dev/blog/anyrouter-chatgpt). Sau đó yêu cầu publish bằng ngôn ngữ tự nhiên.

```text
@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.
```

_Name the tool so the chat does not reach for another app._

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.

| Visibility | Who can open it | Gallery | Search engines |
| --- | --- | --- | --- |
| `private` | Only you | No | No |
| `unlisted` | Anyone with the URL | No | No |
| `public` | Anyone with the URL | Yes | Yes |

- 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](https://anyrouter.dev/blog/introducing-anyrouter-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](https://anyrouter.dev/dashboard/artifacts)
