api.hosts

create()

api.hosts.create({ runtime, framework, label, slug? }) → Promise<Host>

Creates a host and reserves its address. The slug comes from the label, or you impose it — it is never quietly corrected.

POST /api/hostingslug is the URLreserved names refused
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const site = await api.hosts.create({ runtime: "static", framework: "vite", label: "Portfolio" });
// { id, runtime: "static", framework: "vite", slug: "portfolio", url: "https://portfolio.…", status: "empty" }
site = api.hosts.create(runtime="static", framework="vite", label="Portfolio")
# site.id, site.runtime == "static", site.framework == "vite", site.slug == "portfolio",
# site.url == "https://portfolio.…", site.status == "empty"
runtimestringrequired

static or edge.

frameworkstring

For static: html, vite, react, vue, angular, astro or next-static. For edge: worker or hono.

labelstring

The name a person reads.

slugstring

The first part of the address. Derived from the label otherwise.

The slug is the address

It cannot be changed afterwards

Changing it would break links already shared, the custom domain attached to it and the certificate issued for that hostname. For another address, create another host — and update() changes the label only.

An invalid slug is refused, not fixed

A slug corrected on your behalf gives an address nobody asked for, discovered later in a link that does not work. invalid_slug says so while you are still choosing.

Reserved names

The names a platform answers for — the ones used for mail, for signing in, for billing, for administration — are not available. That is what keeps a customer from taking one; the one-level-per-kind addressing is the real protection, and this is the belt.

Errors

CodeStatusWhen
unsupported_runtime400A runtime other than static or edge.
unsupported_framework400The framework is incompatible with the selected runtime.
invalid_slug400Not a usable slug, or a reserved name.
slug_taken409Someone has it.
hosting_limit403The plan's count is used.
hosting_not_in_plan403The plan has no hosting at all.
hosting_kind_unavailable501That kind cannot serve yet.

It starts empty

status: "empty" and nothing online. deploy() is what puts something there.