Hanzo
OpenapiPlatform

Runs a container image and gives back a URL.

Runs a container image and gives back a URL.

POST /v1/platform/run

Addresshttps://api.hanzo.ai/v1/platform/run
MethodPOST
Operationpost_platform_run
AuthAuthorization: Bearer $HANZO_API_KEY

Runs a container image and gives back a URL.

The one-call shortcut over project → app → deploy: give it a name and an image and it creates or updates an image-source application in your org's DEFAULT project, deploys it through the same operator Service-CR writer everything else uses, and answers its id, name, live URL, status and shape. Re-running the same name UPDATES it in place, so the call is idempotent by name.

What it produces is a first-class application, not a special object: it is listable, stoppable and redeployable through the /v1/platform routes like any other app.

minScale is the replica floor. maxScale above it declares an autoscaling ceiling; maxScale: 0 means no autoscaler at all — a fixed run at the floor. Both are clamped to the deployment's limits. runtime and shape are accepted for the client contract and echoed back: the image is the runtime unit and sizing is the operator's default.

It is BILLING-GATED before it touches the cluster: a flat per-run fee is authorized against the org's own prepaid balance first, so an org that cannot pay is refused without anything being created. An unreachable cluster is 503 — a run never reports a URL it did not create. Secret env is sealed into KMS and fails closed without it.

Requires a validated principal; 403 without one. The org is resolved from that validated identity and is what both pays and owns the namespace — it is never read from the body.

Request

12 fields, body application/json (required).

FieldInTypeRequiredDescription
envbodyEnvVarJSON[]Env is the run's environment.
env[].keybodystringKey is the variable's name in the container, which must match ^[A-Za-z_][A-Za-z0-9_]*$.
env[].secretbodybooleanSecret says the value lives in KMS and never in the database.
env[].valuebodystringValue is the plaintext, and it is WRITE-ONLY once the entry is secret: a sealed value reads back as "", and sending "" again KEEPS what is sealed rather than…
gpubodyintegerGPU is how many GPUs the run asks for; a negative value is 400.
imagebodystringImage is the container image to run.
maxScalebodyintegerMaxScale above the floor declares an autoscaling ceiling; 0 means no autoscaler at all — a fixed run at the floor.
minScalebodyintegerMinScale is the replica floor, clamped to the deployment's limit.
namebodystringName is the run's name, and the slug is derived from it. Required, and it must resolve to ^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$.
portbodyintegerPort is the container port the run listens on.
runtimebodystringRuntime is accepted for the client contract and echoed nowhere: the image IS the runtime unit.
shapebodystringShape is a compute size label, echoed back; sizing is the operator's default.

Response

StatusBodyMeaning
202runViewaccepted

202 body — 5 fields.

FieldInTypeAlwaysDescription
idbodystringID is the application id the run created or converged.
namebodystringName is the run's name, as stored.
shapebodystringShape is the compute size label the request asked for, or "auto".
statusbodystringStatus is the application's state — deploying on a fresh accept.
urlbodystringURL is the run's live HTTPS address.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.


Platform API · All Hanzo APIs · Interactive reference

How is this guide?

On this page