Hanzo
OpenapiFunctions

Runs a function and records a REAL invocation.

Runs a function and records a REAL invocation.

POST /v1/functions/{name}/invoke

Addresshttps://api.hanzo.ai/v1/functions/{name}/invoke
MethodPOST
Operationpost_functions_by_name_invoke
AuthAuthorization: Bearer $HANZO_API_KEY

Runs a function and records a REAL invocation.

The answer is the invocation record whatever happened to it: 200 when the org's code ran clean, 502 when it ran and failed, 503 when this deployment has no sandbox to run code in. The record IS the evidence, so it rides the failure rather than being replaced by an error envelope.

Billing is two-part and both parts are prepaid-then-metered on the one shared meter: a flat per-invocation request fee, gated BEFORE any sandbox compute runs so an unfunded org gets 402 and nothing executes, and a usage-native GB-seconds compute debit taken after the run. Either is independently free when its fee is zero, so an operator can bill by request alone, by compute alone, or by both — and a zero request fee removes the balance gate with it.

A TRANSPORT failure is not charged: the sandbox being unreachable ran no billable compute. Code that ran and exited non-zero IS charged — that is a successful invocation of a failing program, not a billing failure.

When the sandbox is not configured on this deployment, a non-fleet function fails closed before anything is recorded — no execution and no fabricated output. Scoped to the caller's org; requires a validated principal.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
namepathstringyes
inputbodystringInput is what the function is given on stdin.

Response

StatusBodyMeaning
200invocationViewok
502invocationViewbad gateway
503invocationViewservice unavailable

200 body — 6 fields.

FieldInTypeAlwaysDescription
durationMsbodyintegerhow long it took
idbodystringthe invocation's handle
methodbodystringthe HTTP method that triggered it
statusbodystringhow the run ended: ok, error or timeout
statusCodebodyintegerCode is the status the function's OWN code answered with, which is not the status of the reply — a program can answer 500 through a healthy sandbox.
timebodystringwhen it ran, RFC3339

Failure carries the platform error shape — see Errors.

Examples

hanzo functions invoke <name>

Functions API · All Hanzo APIs · Interactive reference

How is this guide?

On this page