# Get knowledge usage

```http
GET https://trydimmi.com/api/v1/knowledge/usage
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:read`.

## Response 200 (OK)

- `data` (object, required)
  - `lines` (object[] | null, required): The month's usage per source and kind, the largest first.
    - `browser_ms` (integer, required): Browser time spent reading pages for this line, in milliseconds.
    - `estimated_tokens` (integer, required): How many of the input tokens were estimated rather than reported by the provider.
    - `input_tokens` (integer, required): How many tokens were embedded for this line.
    - `kind` (string, required): What was used: embedding (turning text into vectors) or crawl (reading pages).
    - `requests` (integer, required): How many calls were made for this line.
    - `source_id` (string | null, required): Id of the knowledge source, starting with ks_. Null for the workspace's own articles and conversations.
    - `source_name` (string, required): Name of the knowledge source the usage belongs to.
    - `source_type` (string, required): The kind of that source, such as website or notion.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `period_start` (string, required): The first day of the month the usage is for, in UTC, written YYYY-MM-DD, such as 2026-11-01.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request GET \
  --url 'https://trydimmi.com/api/v1/knowledge/usage' \
  --header 'Authorization: Bearer <token>'
```

## Example response

```json
{
  "data": {
    "lines": [
      {
        "browser_ms": 123,
        "estimated_tokens": 123,
        "input_tokens": 123,
        "kind": "<string>",
        "requests": 123,
        "source_id": "<string>",
        "source_name": "<string>",
        "source_type": "<string>"
      }
    ],
    "object": "<string>",
    "period_start": "<string>"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
