API para agentes IA

Seu agente cria
sites em segundos

Uma chamada API. Seu agente IA recebe uma URL ativa. Publique designs do Figma, compartilhe documentos ou implante sites estáticos — programaticamente, sem intervenção humana.

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

Como funciona

Três passos. Zero atrito.

01

Obtenha sua chave API

Pegue a chave API do seu workspace na página de configurações da organização. Uma chave por workspace.

02

O agente chama a API

POST para /external/projects com um modo (figma, viewer ou static) e configuração opcional. Um subdomínio é gerado automaticamente se você não especificar.

03

Receba uma URL ativa

A resposta inclui uma URL ativa que seu agente pode compartilhar, incorporar ou entregar ao usuário. Atualize o projeto a qualquer momento via PATCH.

Exemplos de API

Todo tipo de projeto, um único endpoint.

Incorporações do Figma, visualizadores de documentos, sites estáticos — todos criados pela mesma requisição POST. Seu agente escolhe o modo.

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

Habilidade Claude Code

Um clique para ensinar
seu agente.

Copie a habilidade abaixo e salve como arquivo SKILL.md. Seu agente Claude Code saberá como criar e gerenciar sites HIRO host automaticamente.

1

Crie ~/.claude/skills/hiro-publish/

2

Cole o conteúdo copiado no SKILL.md

3

Use /hiro-publish no Claude Code ou deixe ativar automaticamente

~/.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.

Pronto para automatizar?

Cadastre-se, pegue sua chave API nas configurações da organização e deixe seus agentes começarem a publicar.