# SMS usage (volumes)

Returns the SMS usage (volumes).

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

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

## Query parameters

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

## Example request

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

```ts
const res = await fetch("https://api.pozy.ai/v1/usage/sms", {
  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/sms",
    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`. Can be null
- `totals`, object
  - `sent`, integer
  - `received`, integer
  - `total`, integer
- `groups`, array of object
  - `key`, string
  - `sent`, integer
  - `received`, integer
  - `total`, integer

```json
{
  "since": "2026-10-02T09:00:00.000Z",
  "until": "2026-10-02T09:00:00.000Z",
  "groupBy": "day",
  "totals": {
    "sent": 1,
    "received": 1,
    "total": 42
  },
  "groups": [
    {
      "key": "string",
      "sent": 1,
      "received": 1,
      "total": 42
    }
  ]
}
```
