# List usage

URL: https://docs.hanzo.ai/docs/openapi/git/get-git-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`

> [Git →](https://docs.hanzo.ai/docs/openapi/git) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **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`     | git.usageView   | ok      |
| `default` | problem-details | refused |

`200` body — 6 fields.

| Field               | In   | Type             | Always | Description                                                               |
| ------------------- | ---- | ---------------- | ------ | ------------------------------------------------------------------------- |
| `org`               | body | string           | —      | Org the rollup is for.                                                    |
| `repos`             | body | git.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 (int64)  | —      | SizeBytes is the repo's on-disk size at its last measurement.             |
| `totalBytes`        | body | integer (int64)  | —      | TotalBytes is the sum over Repos — the org's whole git footprint.         |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo git usage
```

**SDK**

**.ts**

```ts
import { Configuration, GitApi } from 'hanzoai';

const api = new GitApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getGitUsage();
```

**.py**

```python
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()
```

**.go**

```go
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
}
```

**.rs**

```rust
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?;
```

**.java**

```java
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();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/git/usage \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `git`, op `get_git_usage` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
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](https://docs.hanzo.ai/docs/openapi/git) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
