> This page is for mk.io.

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

# Get usage report

POST https://app.mk.io/api/v1/organization/reports/usage
Content-Type: application/json

Returns meter-level usage aggregated by set granularity over the specified date range.

- Can be filtered by `projectNames`, `paymentMethodIds` or `meterNames`.
- Maximum date range depends on granularity: 31 days (`hour`), 1 year (`day`), unlimited (`week`, `month`, `year`).
- Day boundaries use UTC; `startDate` is inclusive and `endDate` is exclusive (previously also inclusive).
- To get a monthly report for January, use `startDate=2026-01-01` and `endDate=2026-02-01`.
- The response include `date` and `date_processed` fields. `date` is the time when the usage happened, while `date_processed` is when the usage was ingested into our system and processed for billing purposes.
- Set `filterOnReportedDate=true` to filter by `date_processed` instead of `date`. This might include usage that occurred before the `startDate` if it was processed during the date range.
- Set `format=csv` and `download=true` to receive a file download.

RBAC Capability Required: `core.customer.get`

Reference: https://mediakind.ferndocs.com/mkio/api/management/reports/get-usage-report

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a CustomerUsageQueryData.

- `endDate` (date, required) — End date of the usage report (exclusive). This use to be inclusive. To get a full month of usage, set both startDate and endDate to the first of the month. Maximum range depends on granularity: 31 days for 'hour', 1 year for 'day', unlimited for 'week', 'month', or 'year'.",
- `startDate` (date, required) — Start date of the usage report (inclusive).
- `download` (boolean, optional, default: false) — When true, sets response headers to prompt a browser file download.
- `filterOnReportedDate` (boolean, optional, default: false) — When true, filters usage by report_time (when the usage was charged) rather than sample_time (when it occurred). Useful for reconciling against invoice dates. Defaults to false.
- `format` (enum, optional, default: json) — Response format. Either 'json' or 'csv'. Defaults to 'json'.
  - Allowed values: `json`, `csv`
- `granularity` (enum, optional, default: day) — Time bucket for aggregation. Defaults to 'day'.
  - Allowed values: `year`, `month`, `week`, `day`, `hour`
- `groupBy` (list of string, optional) — Fields to group results by. Only 'meter' is currently valid. Defaults to ['meter'].
- `meterNames` (list of string, optional) — Filter results to the specified meter names.
- `paymentMethodIds` (list of string, optional) — Filter results to the specified payment method IDs. Mutually exclusive with projectNames.
- `projectNames` (list of string, optional) — Filter results to the specified project names. Mutually exclusive with paymentMethodIds.

## Response

### 200

OK

- `supplemental` (SupplementalData, required) — Metadata pertaining to the query.
- `value` (list of MeterData, required) — The usage data per day per meter

## Errors

### 400 Bad Request Error

Bad Request

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 401 Unauthorized Error

Unauthorized

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 403 Forbidden Error

Forbidden

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 404 Not Found Error

Not Found

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 409 Conflict Error

Conflict

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 429 Too Many Requests Error

Too Many Requests

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 500 Internal Server Error

Internal Server Error

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

## Types

### SupplementalData

- `download` (boolean, required) — Whether browser was indicated to download file
- `end` (date, required) — The end date of the query.
- `filters` (SupplementalFiltersData, required) — The filters applied to the query.
- `format` (string, required) — The output format. Either csv or json.
- `granularity` (string, required) — The time bucket used for aggregation.
- `groupBy` (list of string, required) — The list of fields that the results are grouped by.
- `records` (integer, required) — The number of result records returned.
- `start` (date, required) — The start date of the query.

### MeterData

- `cost` (string, required) — Monetary value of usage for this record, in the currency specified by the currency field. How this is charged depends on the entitlement type: for a license entitlement the amount is fully covered and nothing is billed; for cash, quantity, or pre-commitment entitlements this amount is deducted from the entitlement balance; with no entitlement the amount is billed directly.
- `currency` (string, required) — The currency of the cost field.
- `date` (datetime, required) — The date and time of this usage record. Truncated to the granularity of the query (e.g. if granularity is 'day' then time will be 00:00:00).
- `meterName` (string, required) — The meter name.
- `quantity` (double, required) — Total units accrued for this record.
- `dateProcessed` (datetime, optional, nullable) — The report_time truncated to the requested granularity. Null for usage that has not yet been charged. Comparing against date (sample_time) reveals late-reported data.
- `entitlement` (string, optional, nullable) — The ID of the entitlement applied to this usage. Can be joined against the /entitlements endpoint.
- `entitlementType` (string, optional, nullable) — The type of entitlement applied to this usage, if any.
- `family` (string, optional) — Product family this meter belongs to.
- `meterSku` (string, optional, nullable) — The SaaS SKU identifier for this meter.
- `paymentMethod` (string, optional) — The ID of the payment method associated with this usage.
- `paymentMethodName` (string, optional, nullable) — The display name of the payment method associated with this usage.
- `price` (double, optional) — Per-unit price for this record (cost / quantity).
- `project` (string, optional) — The name of the project this usage belongs to.
- `solution` (string, optional) — Solution within the product family this meter belongs to.
- `unit` (string, optional, nullable) — The unit that this meter is reported in, e.g. 'gigabytes' or 'minutes'.

### ErrorDetail

- `code` (string, required) — The error code.
- `detail` (string, required) — The error message.
- `extraDetail` (map from string to any, optional) — Extra information regarding this error.

### SupplementalFiltersData

- `meterNames` (list of string, required) — Meter names the results were filtered to.
- `paymentMethodIds` (list of string, required) — Payment method IDs the results were filtered to.
- `projectNames` (list of string, required) — Project names the results were filtered to.

## Examples

### Download a full month of billing data for a payment method as a CSV file.

**Request**

```json
{
  "endDate": "2025-04-01",
  "startDate": "2025-03-01",
  "download": true,
  "filterOnReportedDate": true,
  "format": "csv",
  "granularity": "hour",
  "paymentMethodIds": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  ]
}
```

**Response**

```json
{
  "supplemental": {
    "download": true,
    "end": "2023-01-15",
    "filters": {
      "meterNames": [
        "string"
      ],
      "paymentMethodIds": [
        "string"
      ],
      "projectNames": [
        "string"
      ]
    },
    "format": "string",
    "granularity": "string",
    "groupBy": [
      "string"
    ],
    "records": 1,
    "start": "2023-01-15"
  },
  "value": [
    {
      "cost": "string",
      "currency": "string",
      "date": "2024-01-15T09:30:00Z",
      "meterName": "string",
      "quantity": 1.1,
      "dateProcessed": "2024-01-15T09:30:00Z",
      "entitlement": "string",
      "entitlementType": "string",
      "family": "string",
      "meterSku": "string",
      "paymentMethod": "string",
      "paymentMethodName": "string",
      "price": 1.1,
      "project": "string",
      "solution": "string",
      "unit": "string"
    }
  ]
}
```

**SDK Code**

```python Download a full month of billing data for a payment method as a CSV file.
import requests

url = "https://app.mk.io/api/v1/organization/reports/usage"

payload = {
    "endDate": "2025-04-01",
    "startDate": "2025-03-01",
    "download": True,
    "filterOnReportedDate": True,
    "format": "csv",
    "granularity": "hour",
    "paymentMethodIds": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Download a full month of billing data for a payment method as a CSV file.
const url = 'https://app.mk.io/api/v1/organization/reports/usage';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"endDate":"2025-04-01","startDate":"2025-03-01","download":true,"filterOnReportedDate":true,"format":"csv","granularity":"hour","paymentMethodIds":["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}'
};

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

```go Download a full month of billing data for a payment method as a CSV file.
package main

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

func main() {

	url := "https://app.mk.io/api/v1/organization/reports/usage"

	payload := strings.NewReader("{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-01\",\n  \"download\": true,\n  \"filterOnReportedDate\": true,\n  \"format\": \"csv\",\n  \"granularity\": \"hour\",\n  \"paymentMethodIds\": [\n    \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Download a full month of billing data for a payment method as a CSV file.
require 'uri'
require 'net/http'

url = URI("https://app.mk.io/api/v1/organization/reports/usage")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-01\",\n  \"download\": true,\n  \"filterOnReportedDate\": true,\n  \"format\": \"csv\",\n  \"granularity\": \"hour\",\n  \"paymentMethodIds\": [\n    \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n  ]\n}"

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

```java Download a full month of billing data for a payment method as a CSV file.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.mk.io/api/v1/organization/reports/usage")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-01\",\n  \"download\": true,\n  \"filterOnReportedDate\": true,\n  \"format\": \"csv\",\n  \"granularity\": \"hour\",\n  \"paymentMethodIds\": [\n    \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n  ]\n}")
  .asString();
```

```php Download a full month of billing data for a payment method as a CSV file.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.mk.io/api/v1/organization/reports/usage', [
  'body' => '{
  "endDate": "2025-04-01",
  "startDate": "2025-03-01",
  "download": true,
  "filterOnReportedDate": true,
  "format": "csv",
  "granularity": "hour",
  "paymentMethodIds": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Download a full month of billing data for a payment method as a CSV file.
using RestSharp;

var client = new RestClient("https://app.mk.io/api/v1/organization/reports/usage");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-01\",\n  \"download\": true,\n  \"filterOnReportedDate\": true,\n  \"format\": \"csv\",\n  \"granularity\": \"hour\",\n  \"paymentMethodIds\": [\n    \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Download a full month of billing data for a payment method as a CSV file.
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "endDate": "2025-04-01",
  "startDate": "2025-03-01",
  "download": true,
  "filterOnReportedDate": true,
  "format": "csv",
  "granularity": "hour",
  "paymentMethodIds": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.mk.io/api/v1/organization/reports/usage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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

### Hour-by-hour usage for a single meter over a short window.

**Request**

```json
{
  "endDate": "2025-04-01",
  "startDate": "2025-03-25",
  "format": "json",
  "granularity": "hour",
  "meterNames": [
    "video_encoding_ondemand"
  ],
  "projectNames": [
    "my-project"
  ]
}
```

**Response**

```json
{
  "supplemental": {
    "download": true,
    "end": "2023-01-15",
    "filters": {
      "meterNames": [
        "string"
      ],
      "paymentMethodIds": [
        "string"
      ],
      "projectNames": [
        "string"
      ]
    },
    "format": "string",
    "granularity": "string",
    "groupBy": [
      "string"
    ],
    "records": 1,
    "start": "2023-01-15"
  },
  "value": [
    {
      "cost": "string",
      "currency": "string",
      "date": "2024-01-15T09:30:00Z",
      "meterName": "string",
      "quantity": 1.1,
      "dateProcessed": "2024-01-15T09:30:00Z",
      "entitlement": "string",
      "entitlementType": "string",
      "family": "string",
      "meterSku": "string",
      "paymentMethod": "string",
      "paymentMethodName": "string",
      "price": 1.1,
      "project": "string",
      "solution": "string",
      "unit": "string"
    }
  ]
}
```

**SDK Code**

```python Hour-by-hour usage for a single meter over a short window.
import requests

url = "https://app.mk.io/api/v1/organization/reports/usage"

payload = {
    "endDate": "2025-04-01",
    "startDate": "2025-03-25",
    "format": "json",
    "granularity": "hour",
    "meterNames": ["video_encoding_ondemand"],
    "projectNames": ["my-project"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Hour-by-hour usage for a single meter over a short window.
const url = 'https://app.mk.io/api/v1/organization/reports/usage';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"endDate":"2025-04-01","startDate":"2025-03-25","format":"json","granularity":"hour","meterNames":["video_encoding_ondemand"],"projectNames":["my-project"]}'
};

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

```go Hour-by-hour usage for a single meter over a short window.
package main

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

func main() {

	url := "https://app.mk.io/api/v1/organization/reports/usage"

	payload := strings.NewReader("{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-25\",\n  \"format\": \"json\",\n  \"granularity\": \"hour\",\n  \"meterNames\": [\n    \"video_encoding_ondemand\"\n  ],\n  \"projectNames\": [\n    \"my-project\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Hour-by-hour usage for a single meter over a short window.
require 'uri'
require 'net/http'

url = URI("https://app.mk.io/api/v1/organization/reports/usage")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-25\",\n  \"format\": \"json\",\n  \"granularity\": \"hour\",\n  \"meterNames\": [\n    \"video_encoding_ondemand\"\n  ],\n  \"projectNames\": [\n    \"my-project\"\n  ]\n}"

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

```java Hour-by-hour usage for a single meter over a short window.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.mk.io/api/v1/organization/reports/usage")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-25\",\n  \"format\": \"json\",\n  \"granularity\": \"hour\",\n  \"meterNames\": [\n    \"video_encoding_ondemand\"\n  ],\n  \"projectNames\": [\n    \"my-project\"\n  ]\n}")
  .asString();
```

```php Hour-by-hour usage for a single meter over a short window.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.mk.io/api/v1/organization/reports/usage', [
  'body' => '{
  "endDate": "2025-04-01",
  "startDate": "2025-03-25",
  "format": "json",
  "granularity": "hour",
  "meterNames": [
    "video_encoding_ondemand"
  ],
  "projectNames": [
    "my-project"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Hour-by-hour usage for a single meter over a short window.
using RestSharp;

var client = new RestClient("https://app.mk.io/api/v1/organization/reports/usage");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"endDate\": \"2025-04-01\",\n  \"startDate\": \"2025-03-25\",\n  \"format\": \"json\",\n  \"granularity\": \"hour\",\n  \"meterNames\": [\n    \"video_encoding_ondemand\"\n  ],\n  \"projectNames\": [\n    \"my-project\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Hour-by-hour usage for a single meter over a short window.
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "endDate": "2025-04-01",
  "startDate": "2025-03-25",
  "format": "json",
  "granularity": "hour",
  "meterNames": ["video_encoding_ondemand"],
  "projectNames": ["my-project"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.mk.io/api/v1/organization/reports/usage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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

### Monthly usage totals across all projects and payment methods on the organisation.

**Request**

```json
{
  "endDate": "2026-01-01",
  "startDate": "2025-01-01",
  "format": "json",
  "granularity": "month"
}
```

**Response**

```json
{
  "supplemental": {
    "download": true,
    "end": "2023-01-15",
    "filters": {
      "meterNames": [
        "string"
      ],
      "paymentMethodIds": [
        "string"
      ],
      "projectNames": [
        "string"
      ]
    },
    "format": "string",
    "granularity": "string",
    "groupBy": [
      "string"
    ],
    "records": 1,
    "start": "2023-01-15"
  },
  "value": [
    {
      "cost": "string",
      "currency": "string",
      "date": "2024-01-15T09:30:00Z",
      "meterName": "string",
      "quantity": 1.1,
      "dateProcessed": "2024-01-15T09:30:00Z",
      "entitlement": "string",
      "entitlementType": "string",
      "family": "string",
      "meterSku": "string",
      "paymentMethod": "string",
      "paymentMethodName": "string",
      "price": 1.1,
      "project": "string",
      "solution": "string",
      "unit": "string"
    }
  ]
}
```

**SDK Code**

```python Monthly usage totals across all projects and payment methods on the organisation.
import requests

url = "https://app.mk.io/api/v1/organization/reports/usage"

payload = {
    "endDate": "2026-01-01",
    "startDate": "2025-01-01",
    "format": "json",
    "granularity": "month"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Monthly usage totals across all projects and payment methods on the organisation.
const url = 'https://app.mk.io/api/v1/organization/reports/usage';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"endDate":"2026-01-01","startDate":"2025-01-01","format":"json","granularity":"month"}'
};

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

```go Monthly usage totals across all projects and payment methods on the organisation.
package main

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

func main() {

	url := "https://app.mk.io/api/v1/organization/reports/usage"

	payload := strings.NewReader("{\n  \"endDate\": \"2026-01-01\",\n  \"startDate\": \"2025-01-01\",\n  \"format\": \"json\",\n  \"granularity\": \"month\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Monthly usage totals across all projects and payment methods on the organisation.
require 'uri'
require 'net/http'

url = URI("https://app.mk.io/api/v1/organization/reports/usage")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"endDate\": \"2026-01-01\",\n  \"startDate\": \"2025-01-01\",\n  \"format\": \"json\",\n  \"granularity\": \"month\"\n}"

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

```java Monthly usage totals across all projects and payment methods on the organisation.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.mk.io/api/v1/organization/reports/usage")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"endDate\": \"2026-01-01\",\n  \"startDate\": \"2025-01-01\",\n  \"format\": \"json\",\n  \"granularity\": \"month\"\n}")
  .asString();
```

```php Monthly usage totals across all projects and payment methods on the organisation.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.mk.io/api/v1/organization/reports/usage', [
  'body' => '{
  "endDate": "2026-01-01",
  "startDate": "2025-01-01",
  "format": "json",
  "granularity": "month"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Monthly usage totals across all projects and payment methods on the organisation.
using RestSharp;

var client = new RestClient("https://app.mk.io/api/v1/organization/reports/usage");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"endDate\": \"2026-01-01\",\n  \"startDate\": \"2025-01-01\",\n  \"format\": \"json\",\n  \"granularity\": \"month\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Monthly usage totals across all projects and payment methods on the organisation.
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "endDate": "2026-01-01",
  "startDate": "2025-01-01",
  "format": "json",
  "granularity": "month"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.mk.io/api/v1/organization/reports/usage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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