List usage

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

Addresshttps://api.hanzo.ai/v1/git/usage
MethodGET
Operationget_git_usage
AuthAuthorization: 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

StatusBodyMeaning
200git.usageViewok
defaultproblem-detailsrefused

200 body — 6 fields.

FieldInTypeAlwaysDescription
orgbodystring—Org the rollup is for.
reposbodygit.usageRepo[]—Repos is every repo the org owns, across every project sub-scope.
repos[].namebodystring—Name is the repo's org-unique handle.
repos[].projectbodystring—Project is the sub-scope the repo lives in; absent for the default scope.
repos[].sizeBytesbodyinteger (int64)—SizeBytes is the repo's on-disk size at its last measurement.
totalBytesbodyinteger (int64)—TotalBytes is the sum over Repos — the org's whole git footprint.

Failure carries the platform error shape — see Errors.

Examples

hanzo git usage
import { 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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.GitAPI.GetGitUsage(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(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": {}
         }
       }
     }'

Git API · All Hanzo APIs · Interactive reference

Was this page useful?