Hanzo
OpenapiCode

Answers a question about the caller org's code with a CITED answer: retrieval…

Answers a question about the caller org's code with a CITED answer: retrieval packs grounding context, then the synthesizer writes the answer over exactly…

GET /v1/code/ask

Addresshttps://api.hanzo.ai/v1/code/ask
MethodGET
Operationget_code_ask
AuthAuthorization: Bearer $HANZO_API_KEY

Answers a question about the caller org's code with a CITED answer: retrieval packs grounding context, then the synthesizer writes the answer over exactly those spans, which come back alongside it. It never answers without grounding — with no matched code the answer is empty and says so, and with no synthesizer available the citations still come back with "degraded": true so the caller can reason over the spans itself.

Request

2 fields.

FieldInTypeRequiredDescription
qquerystringQ is the question to answer.
repoquerystringRepo narrows retrieval to one repository.

Response

StatusBodyMeaning
200AskAnswerok

200 body — 9 fields.

FieldInTypeAlwaysDescription
answerbodystringAnswer is the synthesized prose. EMPTY is a real answer here: nothing in the index matched, or synthesis was unavailable — read degraded and citations to…
citationsbodyCitation[]Citations are the exact regions the answer was grounded on, and they are the point: an answer is checkable only because every claim in it can be read back at a…
citations[].endLinebodyintegerEndLine is its last line, inclusive.
citations[].filebodystringFile is the path inside the repo, relative to its root.
citations[].linebodyintegerLine is the first line of the cited region, 1-based.
citations[].repobodystringRepo is the repository the cited code lives in ("owner/name"), absent when the ask was already scoped to one.
citations[].symbolbodystringSymbol is the declaration the region belongs to, when it belongs to one.
degradedbodybooleanDegraded is true when retrieval worked but no synthesizer was reachable.
questionbodystringQuestion is the ask, echoed back.

Failure carries the platform error shape — see Errors.

Examples

hanzo code ask get

Code API · All Hanzo APIs · Interactive reference

How is this guide?

On this page