Hanzo
OpenapiCode

Is askGet with the question in the request BODY, for a question too long or too…

Is askGet with the question in the request BODY, for a question too long or too awkward to put in a URL.

POST /v1/code/ask

Addresshttps://api.hanzo.ai/v1/code/ask
MethodPOST
Operationpost_code_ask
AuthAuthorization: Bearer $HANZO_API_KEY

Is askGet with the question in the request BODY, for a question too long or too awkward to put in a URL. query and repo in the body take precedence over ?q= and ?repo=; either source works alone.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
querybodystringQuery is the question, from the BODY.
repobodystringRepo is the repository narrowing, from the BODY.

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 create

Code API · All Hanzo APIs · Interactive reference

How is this guide?

On this page