# Analytics

Operations related to CFO Board analytics and tenant model rates management.

## Get CFO Board Analytics

`GET /v1/analytics/cfo-board`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `start_date` (query, string, date, optional)
  Type: string, date

- `end_date` (query, string, date, optional)
  Type: string, date

Responses:

- 200: CFO board analytics data

Content type: application/json

Type: object

Schema: [CfoBoardAnalyticsResponse](https://api.prompteasy.eu/docs/api/models/cfoboardanalyticsresponse/index.md)

- `cfo_board_enabled` (required)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- `period` (required)
  Type: object
  
  - `start` (required)
    Type: string, date
    
    Example:
    
    ```json
    "2026-08-01"
    ```
  
  - `end` (required)
    Type: string, date
    
    Example:
    
    ```json
    "2026-08-31"
    ```

- `summary` (required)
  Type: object
  
  - `total_executions` (required)
    Type: integer
    
    Example:
    
    ```json
    100
    ```
  
  - `total_estimated_cost_cents` (required)
    Type: integer
    
    Example:
    
    ```json
    2500
    ```
  
  - `currency` (required)
    Type: string
    
    Example:
    
    ```json
    "EUR"
    ```

- `by_team` (required)
  Type: array
  
  Items:
    Reference: [CfoBoardTeamAnalytics](https://api.prompteasy.eu/docs/api/models/cfoboardteamanalytics/index.md); Type: object

- `by_model` (required)
  Type: array
  
  Items:
    Reference: [CfoBoardModelAnalytics](https://api.prompteasy.eu/docs/api/models/cfoboardmodelanalytics/index.md); Type: object

- `daily_trends` (required)
  Type: array
  
  Items:
    Reference: [CfoBoardDailyTrend](https://api.prompteasy.eu/docs/api/models/cfoboarddailytrend/index.md); Type: object

- 403: Forbidden

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/analytics/cfo-board' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/analytics/cfo-board', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/analytics/cfo-board',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Update CFO Board Tenant Settings

`POST /v1/analytics/cfo-board/settings`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Request body: application/json (required)

Type: object

Schema: [CfoBoardSettingsPayload](https://api.prompteasy.eu/docs/api/models/cfoboardsettingspayload/index.md)

- `cfo_board_enabled` (required)
  Type: boolean
  
  Enable or disable CFO Board analytics for the tenant
  
  Example:
  
  ```json
  true
  ```

Responses:

- 200: Settings updated successfully

Content type: application/json

Type: object

Schema: [CfoBoardSettingsResponse](https://api.prompteasy.eu/docs/api/models/cfoboardsettingsresponse/index.md)

- `message` (required)
  Type: string
  
  Example:
  
  ```json
  "CFO Board settings updated successfully."
  ```

- `cfo_board_enabled` (required)
  Type: boolean
  
  Example:
  
  ```json
  true
  ```

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X POST 'https://api.prompteasy.eu/v1/analytics/cfo-board/settings' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "cfo_board_enabled": true
}'
```

### JavaScript

```javascript
const body = `{
  "cfo_board_enabled": true
}`;

const response = await fetch('https://api.prompteasy.eu/v1/analytics/cfo-board/settings', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "cfo_board_enabled": true
}'''

response = requests.post(
    'https://api.prompteasy.eu/v1/analytics/cfo-board/settings',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## List Tenant Model Rates

`GET /v1/analytics/cfo-board/rates`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Responses:

- 200: List of configured model rates

Content type: application/json

Type: array

Items:
  Reference: [TenantModelRate](https://api.prompteasy.eu/docs/api/models/tenantmodelrate/index.md); Type: object

- 403: Forbidden

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/analytics/cfo-board/rates' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/analytics/cfo-board/rates', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/analytics/cfo-board/rates',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Create Tenant Model Rate

`POST /v1/analytics/cfo-board/rates`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Request body: application/json (required)

Type: object

Schema: [TenantModelRateCreatePayload](https://api.prompteasy.eu/docs/api/models/tenantmodelratecreatepayload/index.md)

- `model_pattern` (required)
  Type: string
  
  Model pattern string or regex to match against actual LLM models
  
  maxLength: 128
  
  Example:
  
  ```json
  "claude-3-5-sonnet"
  ```

- `token_unit` (optional)
  Type: integer
  
  Token unit divisor for pricing (default 1,000,000)
  
  minimum: 1
  
  Example:
  
  ```json
  1000000
  ```

- `prompt_token_cost_cents` (optional)
  Type: number
  
  Cost in cents per token_unit prompt tokens
  
  minimum: 0
  
  Example:
  
  ```json
  300
  ```

- `completion_token_cost_cents` (optional)
  Type: number
  
  Cost in cents per token_unit completion tokens
  
  minimum: 0
  
  Example:
  
  ```json
  1500
  ```

- `cached_prompt_token_cost_cents` (optional)
  Type: number
  
  Cost in cents per token_unit cached prompt tokens
  
  minimum: 0
  
  Example:
  
  ```json
  30
  ```

- `reasoning_token_cost_cents` (optional)
  Type: number
  
  Cost in cents per token_unit reasoning tokens
  
  minimum: 0
  
  Example:
  
  ```json
  0
  ```

Responses:

- 201: Rate created successfully

Content type: application/json

Type: object

Schema: [TenantModelRate](https://api.prompteasy.eu/docs/api/models/tenantmodelrate/index.md)

- `id` (required)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `tenant_id` (required)
  Type: integer
  
  Example:
  
  ```json
  10
  ```

- `model_pattern` (required)
  Type: string
  
  Example:
  
  ```json
  "claude-3-5-sonnet"
  ```

- `token_unit` (required)
  Type: integer
  
  Example:
  
  ```json
  1000000
  ```

- `prompt_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  300
  ```

- `completion_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  1500
  ```

- `cached_prompt_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  30
  ```

- `reasoning_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  0
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2026-08-01T12:00:00Z"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2026-08-01T12:00:00Z"
  ```

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X POST 'https://api.prompteasy.eu/v1/analytics/cfo-board/rates' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "model_pattern": "claude-3-5-sonnet",
  "token_unit": 1000000,
  "prompt_token_cost_cents": 300,
  "completion_token_cost_cents": 1500,
  "cached_prompt_token_cost_cents": 30,
  "reasoning_token_cost_cents": 0
}'
```

### JavaScript

```javascript
const body = `{
  "model_pattern": "claude-3-5-sonnet",
  "token_unit": 1000000,
  "prompt_token_cost_cents": 300,
  "completion_token_cost_cents": 1500,
  "cached_prompt_token_cost_cents": 30,
  "reasoning_token_cost_cents": 0
}`;

const response = await fetch('https://api.prompteasy.eu/v1/analytics/cfo-board/rates', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "model_pattern": "claude-3-5-sonnet",
  "token_unit": 1000000,
  "prompt_token_cost_cents": 300,
  "completion_token_cost_cents": 1500,
  "cached_prompt_token_cost_cents": 30,
  "reasoning_token_cost_cents": 0
}'''

response = requests.post(
    'https://api.prompteasy.eu/v1/analytics/cfo-board/rates',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Update Tenant Model Rate

`PUT /v1/analytics/cfo-board/rates/{rate}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `rate` (path, integer, required)
  Type: integer

Request body: application/json (required)

Type: object

Schema: [TenantModelRateUpdatePayload](https://api.prompteasy.eu/docs/api/models/tenantmodelrateupdatepayload/index.md)

- `model_pattern` (optional)
  Type: string
  
  maxLength: 128
  
  Example:
  
  ```json
  "claude-3-5-sonnet"
  ```

- `token_unit` (optional)
  Type: integer
  
  minimum: 1
  
  Example:
  
  ```json
  1000000
  ```

- `prompt_token_cost_cents` (optional)
  Type: number
  
  minimum: 0
  
  Example:
  
  ```json
  350
  ```

- `completion_token_cost_cents` (optional)
  Type: number
  
  minimum: 0
  
  Example:
  
  ```json
  1500
  ```

- `cached_prompt_token_cost_cents` (optional)
  Type: number
  
  minimum: 0
  
  Example:
  
  ```json
  30
  ```

- `reasoning_token_cost_cents` (optional)
  Type: number
  
  minimum: 0
  
  Example:
  
  ```json
  0
  ```

Responses:

- 200: Rate updated successfully

Content type: application/json

Type: object

Schema: [TenantModelRate](https://api.prompteasy.eu/docs/api/models/tenantmodelrate/index.md)

- `id` (required)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `tenant_id` (required)
  Type: integer
  
  Example:
  
  ```json
  10
  ```

- `model_pattern` (required)
  Type: string
  
  Example:
  
  ```json
  "claude-3-5-sonnet"
  ```

- `token_unit` (required)
  Type: integer
  
  Example:
  
  ```json
  1000000
  ```

- `prompt_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  300
  ```

- `completion_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  1500
  ```

- `cached_prompt_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  30
  ```

- `reasoning_token_cost_cents` (required)
  Type: number
  
  Example:
  
  ```json
  0
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2026-08-01T12:00:00Z"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2026-08-01T12:00:00Z"
  ```

- 403: Forbidden

- 404: Not Found

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X PUT 'https://api.prompteasy.eu/v1/analytics/cfo-board/rates/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "model_pattern": "claude-3-5-sonnet",
  "token_unit": 1000000,
  "prompt_token_cost_cents": 350,
  "completion_token_cost_cents": 1500,
  "cached_prompt_token_cost_cents": 30,
  "reasoning_token_cost_cents": 0
}'
```

### JavaScript

```javascript
const body = `{
  "model_pattern": "claude-3-5-sonnet",
  "token_unit": 1000000,
  "prompt_token_cost_cents": 350,
  "completion_token_cost_cents": 1500,
  "cached_prompt_token_cost_cents": 30,
  "reasoning_token_cost_cents": 0
}`;

const response = await fetch('https://api.prompteasy.eu/v1/analytics/cfo-board/rates/0', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "model_pattern": "claude-3-5-sonnet",
  "token_unit": 1000000,
  "prompt_token_cost_cents": 350,
  "completion_token_cost_cents": 1500,
  "cached_prompt_token_cost_cents": 30,
  "reasoning_token_cost_cents": 0
}'''

response = requests.put(
    'https://api.prompteasy.eu/v1/analytics/cfo-board/rates/0',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Delete Tenant Model Rate

`DELETE /v1/analytics/cfo-board/rates/{rate}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `rate` (path, integer, required)
  Type: integer

Responses:

- 204: Rate deleted successfully

- 403: Forbidden

- 404: Not Found

## Examples

### cURL

```bash
curl -X DELETE 'https://api.prompteasy.eu/v1/analytics/cfo-board/rates/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/analytics/cfo-board/rates/0', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.delete(
    'https://api.prompteasy.eu/v1/analytics/cfo-board/rates/0',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
