Answers a plain-language question about the caller's own books — "what is my…
Answers a plain-language question about the caller's own books — "what is my MRR?", "how long is my runway?" — with figures taken from their ledger, never…
POST /v1/books/ask
| Address | https://api.hanzo.ai/v1/books/ask |
| Method | POST |
| Operation | post_books_ask |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Answers a plain-language question about the caller's own books — "what is my MRR?", "how long is my runway?" — with figures taken from their ledger, never a guessed number. A deterministic keyword router picks the intent and reads the real metrics, and those figures, followups and report sources are computed BEFORE any model call and are never altered by one: the optional narration seam only rephrases the sentence, and it degrades silently to the templated answer when no AI plane is wired. It is strictly read-only — it restates the books, it never posts to them.
Request
3 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
from | body | string | — | From is the RFC3339 start of the metric window. |
question | body | string | — | Question is the plain-language question about the org's books, e.g. |
to | body | string | — | To is the RFC3339 end of the metric window. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | AskResponse | ok |
200 body — 7 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
answer | body | string | — | Answer is one or two sentences answering the question, every number in it taken from Figures. |
figures | body | Figure[] | — | Figures are the grounded numbers the answer states, each already formatted. |
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. |
followups | body | string[] | — | Followups are sharper questions to ask next, chosen from the same intent. |
sources | body | string[] | — | Sources name the books reports the figures were computed from — "pnl", "position", "trial". |
Failure carries the platform error shape — see Errors.
Examples
hanzo books askimport { Configuration, BooksApi } from 'hanzoai';
const api = new BooksApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postBooksAsk({ from: "<from>", question: "<question>" });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).post_books_ask(from="<from>", question="<question>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BooksAPI.PostBooksAsk(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::post_books_ask(&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).postBooksAsk();curl -X POST https://api.hanzo.ai/v1/books/ask \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "<from>",
"question": "<question>"
}'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?