# Calling usage and cost

Returns the calling usage and cost.

```http
GET https://api.pozy.ai/v1/usage/calls
```

- Area: Workspace / Usage
- Auth: Authorization: Bearer pz_live_...

## Query parameters

- `since` (string (date-time))
- `until` (string (date-time))
- `channel` (string): one of whatsapp, pstn
- `number` (string)
- `groupBy` (string): one of day, number, channel

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/usage/calls" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/usage/calls", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/usage/calls",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `since`, string (date-time)
- `until`, string (date-time)
- `groupBy`, string: One of `day`, `number`, `channel`. Can be null
- `totals`, object
  - `calls`, integer
  - `answered`, integer
  - `minutes`, number
  - `billableUSD`, number
  - `metaUSD`, number
  - `brandedCalls`, integer
  - `brandedCallUSD`, number
- `groups`, array of object
  - `key`, string
  - `calls`, integer
  - `answered`, integer
  - `minutes`, number
  - `billableUSD`, number
  - `metaUSD`, number
  - `brandedCalls`, integer
  - `brandedCallUSD`, number

```json
{
  "since": "2026-10-02T09:00:00.000Z",
  "until": "2026-10-02T09:00:00.000Z",
  "groupBy": "day",
  "totals": {
    "calls": 1,
    "answered": 1,
    "minutes": 12.5,
    "billableUSD": 12.5,
    "metaUSD": 12.5,
    "brandedCalls": 1,
    "brandedCallUSD": 12.5
  },
  "groups": [
    {
      "key": "string",
      "calls": 1,
      "answered": 1,
      "minutes": 12.5,
      "billableUSD": 12.5,
      "metaUSD": 12.5,
      "brandedCalls": 1,
      "brandedCallUSD": 12.5
    }
  ]
}
```
