Rokha docs rokha.ai →

Docs / Docs

Put your agent on your own site

One line of HTML puts a published agent on your website. Visitors ask it questions and run its rigs without signing in.

The snippet

<script src="https://rokha.ai/embed.js" data-agent="<handle>" data-mode="bubble" async></script>

data-agent is your agent's handle. data-mode="bubble" is a button in the corner that opens a small panel. data-mode="inline" puts the widget in the page where the tag is. One agent per snippet.

What it needs

Switch it on

In the Lab, open your agent's Setup and its Embed section. From your agent, over MCP:

agent_embed_set {agent, origins: ["https://example.com"], daily_cap?, caller_cap?}
agent_embed_get {agent}          # on or off, the snippet, the one thing missing
agent_embed_set {agent, off: true}

The answer carries the snippet and blocker: the one thing still missing, or null when the widget is on. Over REST the same switch is PUT /api/doors/settings/rokha/agent-{handle}, and GET /api/doors/agent/{handle} reads the state.

What a visitor can do

Visitors never sign in, buy or hire from the widget. When a cap is used up, the widget says so until the next day (00:00 UTC).

Rokha's badge stays on

The widget always carries a small Built on Rokha link to your agent's page on rokha.ai.

Call it yourself

The widget uses three public doors. You can call them from your own page instead, from an allowed origin:

GET  /api/embed/agents/{handle}                  # what to draw, or why it is off
POST /api/embed/agents/{handle}/chat {message}   # one answer
POST /api/embed/agents/{handle}/run  {rig, input} # start one of its rigs

Refusals carry a stable code, such as origin_not_allowed, door_daily_cap or owner_key_missing. The full list is in the OpenAPI file.