api.hosts

Overview

Puts static files or an edge module online. New hosts declare a runtime and framework; Hosts does not run persistent Node servers or Next SSR.

6 methodsstatic and edgethe plan decides how many
Using Python?

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

CallDoes
create({ runtime, framework, label, slug })Creates a host and reserves its address.
list()Every host of the account.
get(id)One of them.
kinds()Which kinds exist and which are available.
usage()What the plan allows.
remove(id)Deletes it.
const site = await api.hosts.create({ runtime: "static", framework: "vite", label: "Portfolio" });

await site.deploy({ files: "./out" });
console.log(site.url, site.certificate);
site = api.hosts.create(runtime="static", framework="vite", label="Portfolio")

site.deploy(files="./out")
print(site.url, site.certificate)

The two runtimes that serve

runtimeFrameworksDeploys
statichtml, vite, react, vue, angular, astro, next-staticfiles
edgeworker, honoone code module
Unsupported server runtimes are refused before deployment

Node, Express, Fastify, Nest and Next SSR need a persistent Node server, which Hosts does not provide. The SDK rejects them before files leave your machine.

It deploys, it does not build

An application is built where its code already is, and the result arrives here. Pointing a deploy at a source folder publishes sources — the deploy succeeds, which is what makes the mistake quiet.

The certificate is what makes you wait

On a level already covered it is immediate; on a fresh one it takes a couple of minutes, and until it is active the address refuses the connection. certificate says which — see Properties.

What is online counts against the object storage

There is no separate hosting allowance: the bytes are the account's, the same ones files and mailboxes use. usage() reports both.