Hanzo
OpenapiCode

Returns the INDEXED content of one file — read_file over the chunks the search…

Returns the INDEXED content of one file — read_file over the chunks the search tiers hold, for pulling up code an agent just found.

GET /v1/code/file

Addresshttps://api.hanzo.ai/v1/code/file
MethodGET
Operationget_code_file
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the INDEXED content of one file — read_file over the chunks the search tiers hold, for pulling up code an agent just found. It is NOT byte-verbatim: the git object plane is the source of record for exact bytes, history and blame. A file absent from the index is a 404, so an agent can tell "not indexed" from "empty file".

Request

2 fields.

FieldInTypeRequiredDescription
pathquerystringPath is the file's repo-relative path.
repoquerystringRepo is the repository the file belongs to.

Response

StatusBodyMeaning
200fileContentok

200 body — 4 fields.

FieldInTypeAlwaysDescription
contentbodystringContent is the file's text as the index stored it.
langbodystringLang is the detected language.
pathbodystringPath echoes the file that was read.
repobodystringRepo echoes the repository it came from.

Failure carries the platform error shape — see Errors.

Examples

hanzo code file

Code API · All Hanzo APIs · Interactive reference

How is this guide?

On this page