# AI Usage

**Summary:** Endpoints for AI Usage

- Role: [Developers](https://www.subrite.no/developers)
- Source: https://www.subrite.no/developers/ai-usage
- Updated: 2026-10-13
- Markdown index: https://www.subrite.no/developers/llms.txt

<a id="get-api-v1-ai-usage-cost"></a>
## Get monthly AI token usage and cost for the current tenant

`GET /api/v1/ai-usage/cost`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

Content type: `application/json` · `AiUsageCostResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `monthly` (Required) | `array of AiUsageMonthlyCostDto` |   |
| `monthly[].subritePrice` (Required when parent is present) | `number` |   |
| `monthly[].currency` (Required when parent is present) | `string` |   |
| `monthly[].callCount` (Required when parent is present) | `number` |   |
| `monthly[].inputTokens` (Required when parent is present) | `number` |   |
| `monthly[].cachedInputTokens` (Required when parent is present) | `number` |   |
| `monthly[].outputTokens` (Required when parent is present) | `number` |   |
| `monthly[].totalTokens` (Required when parent is present) | `number` |   |
| `monthly[].month` (Required when parent is present) | `string` |   |
| `monthly[].unpricedCallCount` (Required when parent is present) | `number` |   |
| `monthly[].features` (Required when parent is present) | `array of AiUsageFeatureCostDto` |   |
| `monthly[].features[].feature` (Required when parent is present) | `string` |   |
| `monthly[].features[].capability` (Required when parent is present) | `string` |   |
| `monthly[].features[].subritePrice` (Required when parent is present) | `number` |   |
| `monthly[].features[].inputTokens` (Required when parent is present) | `number` |   |
| `monthly[].features[].outputTokens` (Required when parent is present) | `number` |   |
| `monthly[].features[].callCount` (Required when parent is present) | `number` |   |
| `total` (Required) | `AiUsageTotalDto` |   |
| `total.subritePrice` (Required) | `number` |   |
| `total.currency` (Required) | `string` |   |
| `total.callCount` (Required) | `number` |   |
| `total.inputTokens` (Required) | `number` |   |
| `total.cachedInputTokens` (Required) | `number` |   |
| `total.outputTokens` (Required) | `number` |   |
| `total.totalTokens` (Required) | `number` |   |

#### 401

unauthorized

#### 403

Content type: `application/json` · `ErrorResponse`

forbiddenResource

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` |   |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "string",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 500

Content type: `application/json` · `ErrorResponse`

internalServerError

Same fields as [Get monthly AI token usage and cost for the current tenant (403)](https://www.subrite.no/developers/ai-usage?md=true#get-api-v1-ai-usage-cost).

### Example request

```bash
curl https://api.subrite.no/api/v1/ai-usage/cost \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "monthly": [
    {
      "features": []
    }
  ],
  "total": {
    "subritePrice": 0,
    "currency": "string",
    "callCount": 0,
    "inputTokens": 0,
    "cachedInputTokens": 0,
    "outputTokens": 0,
    "totalTokens": 0
  }
}
```
