> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kymaapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage by model

> Per-model request, token and cost totals for your account, plus your latest requests and latency.

**days** `integer` (default: 30)

How far back to look, in days. **Defaults to 30** when omitted, and is clamped to a
maximum of **366**. `0`, or a value that is not a number, falls back to 30; a negative value
is raised to 1.

The default is not "all time". Asking for every row an account has ever written costs
seconds on a busy account and almost nobody wants it — the dashboard always sends an
explicit window, so this default only covers callers that name none. Ask for the window
you want.

## Response

```json theme={null}
{
  "by_model": [
    { "model": "qwen-3.6-plus", "requests": 412, "tokens": 1881266, "cost": 1.4732 }
  ],
  "recent": [
    {
      "model": "qwen-3.6-plus",
      "latency_ms": 1840,
      "first_byte_ms": 412,
      "prompt_tokens": 4410,
      "completion_tokens": 212,
      "token_source": "provider",
      "status_code": 200,
      "cost": 0.0028,
      "created_at": "2026-09-22T15:04:11.000Z"
    }
  ],
  "latency": {
    "window_days": 7,
    "n": 398,
    "failed": 14,
    "e2e_p50_ms": 1620,
    "e2e_p95_ms": 5210,
    "headers_n": 398,
    "headers_p50_ms": 390,
    "headers_p95_ms": 1180
  }
}
```

| Field | Meaning |
| - | - |
| `by_model[]` | One row per model you called in the window: `requests`, `tokens` (input and output together) and `cost` |
| `recent[]` | Your last 20 requests, newest first, whatever the window |
| `latency` | Median and p95 latency over the window, successful requests only. `n` is how many requests the figures are computed on, `failed` how many did not succeed. `e2e_*` is the whole request; `headers_*` is time to the response headers. `null` when it could not be computed |

`cost` is what you were charged, in US dollars. Models you did not call in the window
are absent from `by_model` rather than present with zeros.

```bash cURL theme={null}
curl "https://kymaapi.com/v1/auth/usage/models?days=7" \
  -H "Authorization: Bearer ks-your-session-token"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.