# Retrieve usage per client organization

`GET https://api.morevoice.ai/v1/partner/usage`

Usage of each of your client organisations for a date range, and for your wholesale clients its price at wholesale (what you pay) and at your retail prices (what you charge). Closed months use their invoice's figures; other months are estimates (`provisional`). Test keys get an empty report.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `partner_billing_usage_retrieve`.

## Parameters

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `string` | no | The first day (YYYY-MM-DD, your time zone). Default: the first day of the current month. |
| `to` | `string` | no | The last day, inclusive (up to 400 days after `from`). Default: today. |
| `group` | `"client" \| "kind"` | no | `client` (default): `data` has one row per client organisation; `kind`: one row per usage kind across your clients. |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Responses

### 200 OK

OK Returns `PartnerUsageReport`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"partner_usage_report"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `from` | `string` | — |
| `to` | `string` | — |
| `timezone` | `string` | Your time zone: the days and months are its local calendar. |
| `currency` | `"ILS" \| "USD" \| "EUR"` | — |
| `group` | `"client" \| "kind"` | — |
| `provisional` | `boolean` | Some amounts are estimates (a month not invoiced yet, or cut by the range). Closed months with an invoice use the invoice's figures. |
| `data` | `object[]` | — |
| `total` | `object` | The whole range, wholesale clients; your programme fees are on your invoice, not here. |
| `total.wholesale` | `Money` | An amount of money in minor units. |
| `total.retail` | `Money` | An amount of money in minor units. |
| `total.margin` | `Money` | An amount of money in minor units. |

Example:

```json
{
  "currency": "ILS",
  "data": [
    {
      "ai_minutes": 3120.5,
      "billing_mode": "wholesale",
      "events": 1840,
      "kind": null,
      "kinds": [
        {
          "events": 1650,
          "kind": "ai_minute",
          "quantity": 3120.5,
          "retail": {
            "amount": 131061,
            "currency": "ILS"
          },
          "unit": "minute",
          "wholesale": {
            "amount": 81133,
            "currency": "ILS"
          }
        }
      ],
      "margin": {
        "amount": 49928,
        "currency": "ILS"
      },
      "name": "Haifa Dental Clinic",
      "organization": "org_6Hn3QpX8vB2mK9tL4wR7yZ",
      "retail": {
        "amount": 131061,
        "currency": "ILS"
      },
      "wholesale": {
        "amount": 81133,
        "currency": "ILS"
      }
    }
  ],
  "from": "2026-11-01",
  "group": "client",
  "livemode": true,
  "object": "partner_usage_report",
  "provisional": false,
  "timezone": "Asia/Jerusalem",
  "to": "2026-11-30",
  "total": {
    "margin": {
      "amount": 49928,
      "currency": "ILS"
    },
    "retail": {
      "amount": 131061,
      "currency": "ILS"
    },
    "wholesale": {
      "amount": 81133,
      "currency": "ILS"
    }
  }
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const partnerUsageReport = await mv.partnerBilling.usage.retrieve();
console.log(partnerUsageReport);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

partner_usage_report = client.partner_billing.usage.retrieve()
print(partner_usage_report)
```

**cURL**

```sh
curl https://api.morevoice.ai/v1/partner/usage \
  -H "Authorization: Bearer $MOREVOICE_API_KEY"
```
