> This page is for Datasets.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.immix.xyz/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.immix.xyz/_mcp/server.

# Get this month's usage

GET https://datasets.immix.xyz/v1/usage

Your plan, and the bytes and files your downloads have counted this calendar month (UTC), in total and by key, exchange and family. It covers every key of your account, not only the one that asks. Reading it is never counted.

Reference: https://docs.immix.xyz/datasets/reference/http-api/usage/get

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `X-Request-Id` (string, optional) — Your own id for the request: 8 to 128 of `[A-Za-z0-9._-]`. It becomes the request's id and is echoed on the response. A value off that grammar is replaced with a fresh id, never refused.

## Response

### 200

The month's usage and the plan.

- `month` (string, required) — The month, `yyyy-MM`, in UTC.
- `monthly_bytes` (long, required, nullable) — Your plan: the bytes a calendar month may count. `null` means no limit; `0` means no download is admitted.
- `bytes` (long, required) — The bytes counted this month.
- `files` (long, required) — The files counted this month.
- `breakdown` (list of UsageLine, required) — The same downloads by key, exchange and family, ordered by those three. Its lines sum to `bytes` and `files`.

## Errors

### 401 Get Usage Request Unauthorized Error

`UNAUTHENTICATED`: no key was sent, or the key does not exist, was deleted or carries the wrong secret.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

### 403 Get Usage Request Forbidden Error

`FORBIDDEN_PRINCIPAL`: the key is disabled. `CUSTOMER_NOT_ACTIVE`: your customer account is disabled.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

### 429 Get Usage Request Too Many Requests Error

`RATE_LIMITED`: too many requests from this key; wait `Retry-After` seconds.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

### 503 Get Usage Request Service Unavailable Error

`SERVICE_UNAVAILABLE`: the service cannot reach its store or the dataset right now. Nothing about your request is wrong: retry after a short pause.

- `error` (ErrorBody, required)
- `currentVersion` (string, optional) — On a 412 `VERSION_CONFLICT` from a conditional write that met a row: the row's current version (the `ETag` carries the same token); re-read, reapply, retry. Absent from every other response, a 412 for a row that no longer exists included.

## Types

### UsageLine

One key's downloads of one exchange and family.

- `key_id` (string, required) — The id of the key that asked: the `<keyId>` of the key, never its secret.
- `exchange` (string, required) — The exchange code.
- `family` (string, required) — The family.
- `bytes` (long, required) — The bytes counted.
- `files` (long, required) — The files counted.

### ErrorBody

- `code` (string, required) — Machine-readable, UPPER_SNAKE and append-only; tolerate codes you don't know. Branch on this, never on the message.
- `message` (string, required) — For display only; its wording may change at any time.
- `retryable` (boolean, required) — Whether sending the identical request again, after `Retry-After` or a short pause, can succeed with nothing else changed. `false` where something must change first: the request, the caller's standing, or the platform's own records or deployment.
- `requestId` (string, required) — The request's id, also sent as X-Request-Id; quote it to support.

## Examples

**Response**

```json
{
  "month": "2026-11",
  "monthly_bytes": 2000000000000,
  "bytes": 96423014,
  "files": 2,
  "breakdown": [
    {
      "key_id": "3f9a1c0b7d2e4a68",
      "exchange": "OKX",
      "family": "trades",
      "bytes": 96423014,
      "files": 2
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://datasets.immix.xyz/v1/usage"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://datasets.immix.xyz/v1/usage';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://datasets.immix.xyz/v1/usage"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://datasets.immix.xyz/v1/usage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://datasets.immix.xyz/v1/usage")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://datasets.immix.xyz/v1/usage', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://datasets.immix.xyz/v1/usage");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://datasets.immix.xyz/v1/usage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```