Is the org's serverless dashboard over a window: a per-function invocation…
Is the org's serverless dashboard over a window: a per-function invocation costLine and how those invocations ended.
GET /v1/functions/metrics
| Address | https://api.hanzo.ai/v1/functions/metrics |
| Method | GET |
| Operation | get_functions_metrics |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Is the org's serverless dashboard over a window: a per-function invocation costLine and how those invocations ended.
Every point is a REAL count of rows that fell in that bucket — nothing is interpolated or invented, so an empty window draws a flat line rather than a fabricated one.
costCents is null and stays null: there is no per-invocation cost source to read, and reporting a number computed some other way would be a guess presented as a measurement. Requires a validated principal; the read is scoped to its org.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
range | query | string | — | Range is 1H, 6H, 24H (the default), 7D or 30D. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | usage | ok |
200 body — 10 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
costCents | body | integer | — | null — no per-invocation cost source |
series | body | costLine[] | — | one line per function that ran in the window |
series[].key | body | string | — | the function the line is about |
series[].points | body | pointView[] | — | one point per bucket, oldest first |
series[].points[].t | body | string | — | the bucket's start, RFC3339 (UTC) |
series[].points[].v | body | integer | — | how many invocations fell in it — a real count, never interpolated |
status | body | statusBreakdown | — | |
status.error | body | integer | — | invocations that ran and failed |
status.success | body | integer | — | invocations whose code ran and wrote nothing to stderr |
status.timeout | body | integer | — | invocations that hit their configured deadline |
Failure carries the platform error shape — see Errors.
Examples
hanzo functions metricsimport { Configuration, FunctionsApi } from 'hanzoai';
const api = new FunctionsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getFunctionsMetrics();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import FunctionsApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = FunctionsApi(client).get_functions_metrics()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.FunctionsAPI.GetFunctionsMetrics(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, functions_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = functions_api::get_functions_metrics(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.FunctionsApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new FunctionsApi(client).getFunctionsMetrics();curl https://api.hanzo.ai/v1/functions/metrics \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches functions through the functions tool, which names its 10 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_functions"
}
}
}'How is this guide?