API dla agentów AI

Twój agent tworzy
strony w kilka sekund

Jedno wywołanie API. Twój agent AI otrzymuje aktywny URL. Publikuj projekty Figma, udostępniaj dokumenty lub wdrażaj strony statyczne — programistycznie, bez udziału człowieka.

agent.py
# Your AI agent creates a live website
response = requests.post("https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={"mode": "figma", "figmaUrl": url})

# → { "url": "https://my-design.hirohost.site" }

Jak to działa

Trzy kroki. Zero tarcia.

01

Pobierz klucz API

Pobierz klucz API workspace'a ze strony ustawień organizacji. Jeden klucz na workspace.

02

Agent wywołuje API

POST do /external/projects z trybem (figma, viewer lub static) i opcjonalną konfiguracją. Subdomena jest generowana automatycznie, jeśli jej nie podasz.

03

Otrzymaj aktywny URL

Odpowiedź zawiera aktywny URL, który Twój agent może udostępnić, osadzić lub przekazać użytkownikowi. Aktualizuj projekt w dowolnym momencie przez PATCH.

Przykłady API

Każdy typ projektu, jeden endpoint.

Osadzenia Figma, przeglądarki dokumentów, strony statyczne — wszystko tworzone przez to samo żądanie POST. Twój agent wybiera tryb.

Publish a Figma designpython
import requests

resp = requests.post(
    "https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={
        "mode": "figma",
        "figmaUrl": "https://www.figma.com/design/abc/My-Design",
    },
)
print(resp.json()["url"])
# → https://cedar-drift-bloom.hirohost.site
Create a document sitepython
resp = requests.post(
    "https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={
        "mode": "viewer",
        "subdomain": "quarterly-report",
    },
)
# Upload files to the project separately
print(resp.json()["url"])
# → https://quarterly-report.hirohost.site
Deploy a static sitepython
resp = requests.post(
    "https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={
        "mode": "static",
        "subdomain": "docs-preview",
        "spaFallback": True,
    },
)
# Upload ZIP/HTML to the project separately
print(resp.json()["url"])
# → https://docs-preview.hirohost.site
Update a projectpython
requests.patch(
    f"https://api.hiro.host/api/v1/external/projects/{uid}",
    headers={"X-API-Key": API_KEY},
    json={
        "password": "secret123",
        "isActive": True,
        "locale": "fr",
    },
)

Umiejętność Claude Code

Jedno kliknięcie, by nauczyć
swojego agenta.

Skopiuj poniższą umiejętność i zapisz jako plik SKILL.md. Twój agent Claude Code będzie wiedział, jak automatycznie tworzyć i zarządzać stronami HIRO host.

1

Utwórz ~/.claude/skills/hiro-publish/

2

Wklej skopiowaną treść do SKILL.md

3

Użyj /hiro-publish w Claude Code lub pozwól na automatyczną aktywację

~/.claude/skills/hiro-publish/SKILL.md
---
name: hiro-publish
description: >-
  Create and manage websites on HIRO host via API.
  Use when the user wants to publish a Figma design, share a document,
  or deploy a static site to a live URL.
allowed-tools: Bash(curl *)
---

# HIRO host — Publish to web

You can create and manage live websites using the HIRO host API.

## Setup

The user must provide their API key. Ask for it if not provided.
Set it as a variable for the session:

```bash
export HIRO_API_KEY="<the user's API key>"
```

## Base URL

```
https://api.hiro.host/api/v1/external/projects
```

## Create a project

POST to the base URL. Supported modes: `figma`, `viewer`, `static`.

**Figma design:**
```bash
curl -s -X POST "$HIRO_BASE/api/v1/external/projects" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode": "figma", "figmaUrl": "<figma_url>"}'
```

**Document (viewer):**
```bash
curl -s -X POST "$HIRO_BASE/api/v1/external/projects" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode": "viewer", "subdomain": "<optional-name>"}'
```

**Static website:**
```bash
curl -s -X POST "$HIRO_BASE/api/v1/external/projects" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode": "static", "subdomain": "<optional-name>", "spaFallback": true}'
```

Omit `subdomain` to auto-generate a random one (e.g. cedar-drift-bloom).

## Update a project

PATCH with the project UID:

```bash
curl -s -X PATCH "$HIRO_BASE/api/v1/external/projects/<project_uid>" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"isActive": false, "password": "secret"}'
```

## Available fields

Create: `mode`, `subdomain`, `figmaUrl`, `isActive`, `locale`, `password`,
`emailCollectionEnabled`, `downloadsDisabled`, `spaFallback`, `actionMenu`.

Update: all of the above except `mode` and `subdomain`, plus `removePassword`.

## Response

Both endpoints return:
```json
{
  "uid": "...",
  "url": "https://<subdomain>.hirohost.site",
  "host": "...",
  "mode": "...",
  "isActive": true,
  ...
}
```

Always show the user the `url` from the response so they can visit their site.

Gotowy na automatyzację?

Zarejestruj się, pobierz klucz API z ustawień organizacji i pozwól swoim agentom zacząć publikować.