Terminal
Terminal/Skill
Creates a website, landing page or web app from a text prompt with Hostinger's Horizons AI builder, and returns an edit link.
By Hostinger
Works with
npx skills add hostinger/hostinger-agent-skills --skill horizonsHorizons is Hostinger's AI website builder. The API creates a website from a natural-language description and returns a link where the user can preview and edit it. Use it when a user asks to build a website, landing page, blog, or other web application, or to fetch an edit link for an existing Horizons site.
You describe the desired site in natural language (the message), and Horizons generates it. The create call returns a website URL and ID immediately, but generation happens asynchronously — the site is built in the background after the call returns.
The create request takes a message array of message objects. Each has a type (currently text) and the text describing what to build, e.g. "Create a landing page for a coffee shop with a hero section, menu, and contact form."
Horizons websites can only be modified inside the Horizons web interface. To change an existing site, fetch its edit link with GET /websites/{websiteId} and open the returned URL — there is no direct content-editing API.
curl -X POST "https://developers.hostinger.com/api/horizons/v1/websites" \
-H "Authorization: Bearer $HOSTINGER_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": [
{
"type": "text",
"text": "Create a landing page for a coffee shop with a hero section, menu, and contact form"
}
]
}'
Returns a website URL and ID right away; the site continues generating asynchronously. Share the URL with the user to watch progress and preview the result.
Python SDK:
from hostinger_api import Hostinger
client = Hostinger(api_token="YOUR_API_TOKEN")
site = client.horizons.websites.create(
message=[{"type": "text", "text": "Create a portfolio site for a photographer"}]
)
print(site.id, site.url)
TypeScript SDK:
import { Hostinger } from "hostinger-api-sdk";
const client = new Hostinger({ apiToken: "YOUR_API_TOKEN" });
const site = await client.horizons.websites.create({
message: [{ type: "text", text: "Create a portfolio site for a photographer" }],
});
console.log(site.id, site.url);
PHP SDK:
use Hostinger\Api\HostingerApi;
$client = new HostingerApi('YOUR_API_TOKEN');
$site = $client->horizons->websites->create([
'message' => [
['type' => 'text', 'text' => 'Create a portfolio site for a photographer'],
],
]);
echo $site->id . ' ' . $site->url . "\n";
curl -X GET "https://developers.hostinger.com/api/horizons/v1/websites/12345" \
-H "Authorization: Bearer $HOSTINGER_API_TOKEN"
Returns a link to edit the website in the Horizons interface. Use this whenever the user wants to modify, edit, or add features to an existing Horizons site.
| Method | Endpoint | Description |
|---|---|---|
POST | /api/horizons/v1/websites | Create a website from a prompt (async generation) |
GET | /api/horizons/v1/websites/{websiteId} | Get a Horizons editor link for the website |
| Field | Type | Description |
|---|---|---|
message | array | Required. Array of message objects describing the site |
message[].type | string | Message type (currently text) |
message[].text | string | The natural-language description of what to build |
message text — more detail yields a closer first resultGET /websites/{websiteId} rather than caching old URLsAuthorization: Bearer <token> header formatmessage array is missing or emptytype or textGET /websites/{websiteId} opens the site in the Horizons interface even while it finishes building