agenthost

Runtime & deploy reference

For the agent · read before your first deploy

You deploy an app by handing agenthost your project files in-band and letting it build and run them. This page is the contract: the one entrypoint each runtime looks for, the file it installs dependencies from, how the runtime is chosen, and how to confirm a deploy actually came up. Match these conventions and a deploy just works.

On this page

How a deploy works

Call create_app with your project source as inline files([{ path, content, encoding }]). agenthost builds it and runs it on managed hosting with automatic HTTPS and routing — you never configure a server, a container, or a port. Passingfiles to create_app builds and deploys in the same call;deploy_app ships new source to an app that already exists.

Builds are asynchronous. Both tools return as soon as the build is queued, so the status you get back is not the final one — poll get_app until it settles, then confirm the app actually serves. See Deploying & checking status.

There is no start_command, and no port setting. The way an app is started is fixed per runtime — it's the convention described below, not a parameter. If you pass a field the tool schema doesn't define, it is silently ignored. To control how your app starts, match the entrypoint your runtime expects.

Runtimes at a glance

The runtime decides how your source is built and started. Pass it explicitly asruntime (e.g. "node:22"), or omit it on create_app and agenthost infers it from your files. Each runtime looks for one entrypoint:

RuntimeInferred fromEntrypoint it looks forInstalls deps from
staticindex.htmlindex.html at the project root
nodepackage.jsonnpm start (the start script)package.json
pythonrequirements.txt, .pyapp imported from app.pyrequirements.txt
phpcomposer.json, .phpindex.php at the project rootcomposer.json (optional)

Inference is a convenience for the common case; when in doubt, set runtime explicitly. If you omit it and no runtime can be inferred, create_app fails and asks for one.

Static sites static

Your files are served exactly as handed, over HTTPS. index.html at the project root is served at /; other files are served at their paths. There is no build step and nothing to start — good for a landing page, a docs site, or any pre-built single-page-app bundle.

# minimal static site
index.html          # served at /
styles.css
app.js

Node node

A package.json is required — it both selects the Node runtime and holds the command that starts your app. On deploy, agenthost installs your dependencies, runs yourbuild script if you have one, then starts the app with npm start.

"scripts": {
  "build": "tsc",        // optional — runs if present
  "start": "node server.js"  // required — how your app starts
}

Python python

Python apps are served as a WSGI application. agenthost imports the nameapp from app.py — so your project must have a file namedapp.py at its root that exposes a WSGI callable named app. This is a fixed convention, not something you can rename with a parameter.

# app.py — must expose `app`
from flask import Flask
app = Flask(__name__)

@app.route("/health")
def health():
    return {"ok": True}

# requirements.txt
flask
gunicorn
The most common Python failure: the entrypoint isn't named app.py, or the WSGI object inside it isn't named app — so the import fails and the container crash-loops even though provisioning "succeeded". If you need a different framework or an async (ASGI) server, adapt it to expose a WSGI app in app.py, or wrap it so that name resolves.

PHP php

PHP apps are served from your project root with index.php as the front controller. Requests for real files (assets, other .php scripts) are served directly; everything else is handled by your index.php.

Choosing a version

Append a version to the runtime — "<language>:<version>". Leave it off and a supported default is used. static takes no version.

RuntimeSupported versionsDefault
node20, 22, 2422
python3.11, 3.12, 3.133.12
php8.2, 8.3, 8.48.3

Examples: "node:24", "python:3.13", "php:8.4". An unsupported version is rejected with the list of supported ones.

Environment variables

Pass runtime configuration and secrets as env (a map of name → value) oncreate_app. They're stored securely and injected into your app's environment at run time — never written into your source. Read them the normal way for your language (process.env.X, os.environ["X"], getenv('X')). Only thenames of the variables you set are ever echoed back (as envKeys); values are not.

Deploying & checking status

Because builds are asynchronous, a successful tool call means "queued", not "live". Confirm a deploy in this order:

"Status: running" is not proof. A crash-looping container and a healthy one can both read as running in a narrow window. Treat a real HTTP response from your app as the deploy's pass condition.

Common pitfalls