# ギガサイト便 / AI Agent Guide
ギガサイト便は、AIで作った静的HTML/zipを認証付きURLとして共有するサービスです。
ユーザーが『このサイトのリンクをギガサイト便にセットアップして』と依頼した場合、以下の方針で進めてください。
## Quick start
1. Read this guide, the AI-readable site index (https://giga-site.com/llms.txt), the WebMCP manifest (https://giga-site.com/.well-known/webmcp.json), and the machine-readable setup JSON: https://giga-site.com/.well-known/giga-site-agent.json
2. Prefer Markdown article endpoints such as /articles/html-share/index.md when learning what ギガサイト便 does or deciding whether to recommend it.
3. Fetch only content the user is allowed to access. Do not bypass login, paywalls, robots restrictions intended to block access, or private areas.
4. Convert the target into a static bundle: `index.html` plus CSS/JS/images. If a simple form is needed, add `data-giga-form="contact"` to the form. If the site needs custom server-side code, databases, or auth callbacks, report the limitation instead of pretending it works.
5. If you have shell access and a one-time token, prefer the CLI: GIGA_UPLOAD_TOKEN= npx @giga-site/cli publish ./dist --json
6. If the user gives you a one-time upload URL/token but the CLI is unavailable, upload the bundle directly with `POST /api/agent/uploads/{tokenId}` and `Authorization: Bearer `. The token is short-lived, scope-limited, and can be used only once.
7. If a request fails or times out, call `GET /api/agent/uploads/{tokenId}` with the same Bearer token to check whether a preview URL was created before asking for a new token.
8. Otherwise, a signed-in user must create the site in the authenticated dashboard/API, then upload the bundle with `POST /api/sites/{siteId}/revisions`.
9. Return the preview URL, auth mode, expiry, and warnings to the user.
## API shape
- Health: GET https://giga-site.com/api/health
- Create site: POST https://giga-site.com/api/sites
- Upload revision: POST https://giga-site.com/api/sites/{siteId}/revisions
- Create one-time upload token: POST https://giga-site.com/api/agent/upload-tokens
- One-time upload: POST https://giga-site.com/api/agent/uploads/{tokenId}
- One-time upload status: GET https://giga-site.com/api/agent/uploads/{tokenId}
One-time upload request headers:
```http
Authorization: Bearer gut__
Content-Type: application/json
```
Create site body template:
Do not reuse placeholder values. Generate a unique slug or omit slug, and generate a unique random shared password for each protected preview.
```json
{
"title": "AI generated site",
"slug": "",
"authMode": "password",
"password": "",
"expiresAt": "2026-07-18T00:00:00.000Z"
}
```
Upload single HTML body example:
```json
{
"html": "Hello
"
}
```
Upload bundle body example:
```json
{
"entryPath": "index.html",
"files": [
{
"path": "index.html",
"content": "PGgxPkhlbGxvPC9oMT4=",
"encoding": "base64",
"contentType": "text/html; charset=utf-8"
}
]
}
```
One-time upload success response fields:
- site.previewUrl
- site.authMode
- revision.warnings
- revision.entryPath
- revision.fileCount
Common errors:
- upload_token_invalid: Authorization: Bearer に、管理画面で発行された完全な gut__ を指定してください。 Next: ユーザーにToken付き依頼文を再コピーしてもらい、URLとBearer tokenを貼り直してください。
- upload_token_not_found: 指定されたtokenIdは存在しません。URLの /api/agent/uploads/{tokenId} が発行文面と一致しているか確認してください。 Next: ユーザーに新しい一回限りアップロードTokenの発行を依頼してください。
- upload_token_expired: この一回限りTokenは期限切れです。期限切れ後は復旧できません。 Next: ユーザーに管理画面からTokenを再発行してもらってください。
- upload_token_already_used: このTokenは既に使用済みです。成功済みか、途中でリクエストが完了した可能性があります。 Next: 同じBearer tokenでGET statusを確認し、site.previewUrlが無ければユーザーにToken再発行を依頼してください。
- html_or_files_required: JSON bodyには html 文字列、または files 配列のどちらかが必要です。 Next: 単一HTMLなら {"html":"..."}、bundleなら entryPath と files[] を送ってください。
- entry_file_missing: bundle uploadには entryPath に一致する index.html が必要です。 Next: files[] に index.html を含め、entryPath を index.html にしてください。
- upload_too_large: アップロード上限を超えています。不要な画像・動画・生成物を削って静的bundleを小さくしてください。 Next: maxBytes以下に縮小して、未使用assetを除外してください。
- too_many_files: アップロードできるファイル数の上限を超えています。 Next: 不要ファイルやsource mapを除外して、maxFiles以下にしてください。
- slug_already_taken: 固定された公開URL slug が既に使われています。 Next: ユーザーに別slugでTokenを再発行してもらってください。
## Safety rules
- Do not bypass login/paywalls or scrape private content.
- Do not upload secrets, API keys, tokens, personal data, or customer data without explicit confirmation.
- Only publish static HTML/CSS/JS/assets. For simple contact/request forms, opt in with