Metrics returns the org's deterministic SaaS-metrics snapshot over an optional…
Metrics returns the org's deterministic SaaS-metrics snapshot over an optional (from, to] window — MRR, ARR, revenue, COGS, burn, gross margin, net…
GET /v1/books/metrics
| Address | https://api.hanzo.ai/v1/books/metrics |
| Method | GET |
| Operation | get_books_metrics |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Metrics returns the org's deterministic SaaS-metrics snapshot over an optional (from, to] window — MRR, ARR, revenue, COGS, burn, gross margin, net income, cash, deferred revenue, monthly burn and runway — as raw int64-cent figures AND the same figures already formatted. Every number is the ledger, aggregated the one way the books define it, never a guess; it is the grounded read the unified /v1/ask advisor replays.
Request
3 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
sandbox | query | string | — | Sandbox reads the org's SANDBOX ledger when it is exactly "true". |
from | query | string | — | From is the RFC3339 start of the window, exclusive. |
to | query | string | — | To is the RFC3339 end of the window, inclusive. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | MetricsResponse | ok |
200 body — 20 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
arr | body | integer | — | ARR is annualized recurring revenue in cents (MRR × 12). |
burn | body | integer | — | Burn is total expense in cents over the period. |
cash | body | integer | — | Cash is the bank + processor-clearing balance in cents as of To. |
cogs | body | integer | — | COGS is cost of goods sold in cents over the period. |
deferredRevenue | body | integer | — | DeferredRevenue is the customer-wallet liability in cents as of To. |
figures | body | Figure[] | — | Figures is the same snapshot rendered through books' one money formatter. |
figures[].label | body | string | — | Label names the metric, e.g. |
figures[].period | body | string | — | Period is the window the figure covers, e.g. |
figures[].value | body | string | — | Value is the figure already formatted through books' own money formatter, so a consumer never re-derives it. |
from | body | string | — | From is the RFC3339 start of the reporting window, exclusive; absent for all time. |
grossMarginBps | body | integer | — | GrossMarginBps is GrossProfit / Revenue in basis points (7000 = 70%). |
grossProfit | body | integer | — | GrossProfit is Revenue − COGS, in cents. |
monthlyBurn | body | integer | — | MonthlyBurn is net cash burned per month in cents; 0 when not losing cash. |
months | body | integer | — | Months is the window length in whole months used to normalize MRR and burn. |
mrr | body | integer | — | MRR is monthly recurring revenue in cents. |
netIncome | body | integer | — | NetIncome is Revenue − Burn, in cents. |
period | body | string | — | Period is the human window label, e.g. |
revenue | body | integer | — | Revenue is recognized revenue in cents over the period. |
runwayMonths | body | integer | — | RunwayMonths is Cash / MonthlyBurn; -1 means infinite (the org is not burning). |
to | body | string | — | To is the RFC3339 end of the reporting window, inclusive; absent for up to now. |
Failure carries the platform error shape — see Errors.
Examples
hanzo books metricsimport { Configuration, BooksApi } from 'hanzoai';
const api = new BooksApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getBooksMetrics();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import BooksApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = BooksApi(client).get_books_metrics()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BooksAPI.GetBooksMetrics(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, books_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = books_api::get_books_metrics(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.BooksApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new BooksApi(client).getBooksMetrics();curl https://api.hanzo.ai/v1/books/metrics \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches books through the books tool, which names its 24 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_book_accounts"
}
}
}'How is this guide?