Returns per-repo and total storage bytes for the caller's org — the queryable,…
Returns per-repo and total storage bytes for the caller's org — the queryable, per-tenant number commerce and o11y meter on.
GET /v1/git/usage
| Address | https://api.hanzo.ai/v1/git/usage |
| Method | GET |
| Operation | get_git_usage |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns per-repo and total storage bytes for the caller's org — the queryable, per-tenant number commerce and o11y meter on. It spans EVERY project sub-scope, unlike the repo list, so a billing consumer sees the whole tenant footprint in one call. Sizes are last-measured values (create, push, mirror and gc each re-measure), not a live walk of the disk.
Request
GET /v1/git/usage takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | usageView | ok |
200 body — 6 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
org | body | string | — | Org the rollup is for. |
repos | body | usageRepo[] | — | Repos is every repo the org owns, across every project sub-scope. |
repos[].name | body | string | — | Name is the repo's org-unique handle. |
repos[].project | body | string | — | Project is the sub-scope the repo lives in; absent for the default scope. |
repos[].sizeBytes | body | integer | — | SizeBytes is the repo's on-disk size at its last measurement. |
totalBytes | body | integer | — | TotalBytes is the sum over Repos — the org's whole git footprint. |
Failure carries the platform error shape — see Errors.
Examples
hanzo git usageimport { Configuration, GitApi } from 'hanzoai';
const api = new GitApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getGitUsage();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import GitApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = GitApi(client).get_git_usage()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.GitAPI.GetGitUsage(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, git_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = git_api::get_git_usage(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.GitApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new GitApi(client).getGitUsage();curl https://api.hanzo.ai/v1/git/usage \
-H "Authorization: Bearer $HANZO_API_KEY"Tool git, op get_git_usage — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "git",
"arguments": {
"op": "get_git_usage",
"input": {}
}
}
}'How is this guide?