> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Get an organization analytics overview

GET https://api.mixlayer.com/v1/organizations/{org_id}/analytics/overview

When authenticated with an API key, this operation requires `api-read`.

Reference: https://docs.mixlayer.com/api-reference/platform-api/analytics/get-overview

## Authentication

- `Authorization` header (bearer token, required) — Console user session or Mixlayer API key supplied as a Bearer token.

## Request

### Path parameters

- `org_id` (string, required) — Organization ID

### Query parameters

- `range_start` (long, required) — Inclusive Unix timestamp in milliseconds; must be greater than zero.
- `range_end` (long, required) — Exclusive Unix timestamp in milliseconds; must be greater than `range_start`.
- `group_by` (enum, required) — Breakdown dimension.
  - Allowed values: `model`, `api_key_id`, `call_source`, `client_ip`, `client_ua`, `result`, `error_code`, `tool_calls`
- `metric` (enum, required) — Breakdown metric.
  - Allowed values: `requests`, `errors`, `in_tokens`, `cached_in_tokens`, `out_tokens`, `duration`, `p50_latency`, `p95_latency`, `error_rate`
- `buckets` (integer, optional) — Timeseries bucket count, clamped to 1 through 1000. When omitted, the range determines a default of 60, 72, or 96 buckets.
- `f` (list of string, optional) — Repeated filters in `[!]<dimension>:<value>` form.

## Response

### 200

Analytics overview

- `data` (ApiDataResponseOverviewResponseData, required) — Organization analytics for a requested time range.

## Errors

### 400 Bad Request Error

Query parameters are missing or invalid.

- `error` (ApiErrorBody, required) — Structured error details.

### 401 Unauthorized Error

Authentication is missing or invalid.

- `error` (ApiErrorBody, required) — Structured error details.

### 403 Forbidden Error

The authenticated principal cannot perform this operation.

- `error` (ApiErrorBody, required) — Structured error details.

### 404 Not Found Error

The requested resource is not visible to the authenticated principal.

- `error` (ApiErrorBody, required) — Structured error details.

### 500 Internal Server Error

An unexpected server or database error occurred.

- `error` (ApiErrorBody, required) — Structured error details.

### 503 Service Unavailable Error

Analytics is not configured

- `error` (ApiErrorBody, required) — Structured error details.

## Types

### ApiDataResponseOverviewResponseData

Organization analytics for a requested time range.

- `breakdown` (Breakdown, required) — Metrics grouped by the requested dimension.
- `range` (Range, required) — Time range covered by the analytics.
- `status` (StatusBreakdown, required) — Request counts grouped by result status.
- `summary` (Summary, required) — Aggregate metrics for the range.
- `timeseries` (Timeseries, required) — Metrics split into time buckets.
- `tool_calls` (ToolCallsBreakdown, required) — Request counts grouped by called tool.

### ApiErrorBody

Structured error details returned by the platform API.

- `message` (string, required) — Human-readable error message.
- `code` (string, optional, nullable) — Stable machine-readable error code, when available.
- `details` (any, optional) — Error-specific structured context, when available.

### Breakdown

Analytics rows grouped by a requested dimension and metric.

- `dim` (string, required) — Dimension used to group rows.
- `metric` (string, required) — Metric represented by each row's value.
- `rows` (list of BreakdownRow, required) — Highest-value grouped rows.

### Range

Inclusive start and exclusive end of an analytics range.

- `end` (long, required) — Exclusive end time as Unix milliseconds.
- `start` (long, required) — Inclusive start time as Unix milliseconds.

### StatusBreakdown

Request counts grouped by result status.

- `rows` (list of StatusRow, required) — Result-status rows.

### Summary

Aggregate inference metrics for an analytics range.

- `cached_in_tokens` (long, required) — Total cached input tokens.
- `duration_ms` (long, required) — Sum of sequence durations in milliseconds.
- `error_rate` (double, required) — Failed requests divided by total requests.
- `errors` (long, required) — Failed request count.
- `in_tokens` (long, required) — Total non-cached input tokens.
- `out_tokens` (long, required) — Total output tokens.
- `p50_latency_ms` (long, required) — Median gateway latency in milliseconds.
- `p95_latency_ms` (long, required) — 95th-percentile gateway latency in milliseconds.
- `requests` (long, required) — Total request count.

### Timeseries

Inference metrics split into equal time buckets.

- `bucket_ms` (long, required) — Width of each bucket in milliseconds.
- `buckets` (list of TimeseriesBucket, required) — Metrics for each time bucket.

### ToolCallsBreakdown

Request counts grouped by called tool.

- `rows` (list of ToolCallsRow, required) — Tool-call rows.

### BreakdownRow

One grouped analytics result.

- `count` (long, required) — Requests represented by the group.
- `key` (string, required) — Group value, such as a model SKU.
- `value` (double, required) — Requested metric value for the group.

### StatusRow

Count for one request result status.

- `count` (long, required) — Requests with this status.
- `key` (string, required) — Result status.

### TimeseriesBucket

Metrics for one analytics time bucket.

- `cached_in_tokens` (long, required) — Cached input tokens in the bucket.
- `duration_ms` (long, required) — Sum of sequence durations in milliseconds.
- `errors` (long, required) — Failed requests in the bucket.
- `in_tokens` (long, required) — Non-cached input tokens in the bucket.
- `out_tokens` (long, required) — Output tokens in the bucket.
- `p50_latency_ms` (long, required) — Median gateway latency in milliseconds.
- `p95_latency_ms` (long, required) — 95th-percentile gateway latency in milliseconds.
- `requests` (long, required) — Requests started in the bucket.
- `t0` (long, required) — Inclusive bucket start as Unix milliseconds.
- `t1` (long, required) — Exclusive bucket end as Unix milliseconds.

### ToolCallsRow

Count for one called tool.

- `count` (long, required) — Requests that called the tool.
- `key` (string, required) — Tool name.

## Examples

**Response**

```json
{
  "data": {
    "breakdown": {
      "dim": "string",
      "metric": "string",
      "rows": [
        {
          "count": 1,
          "key": "string",
          "value": 1.1
        }
      ]
    },
    "range": {
      "end": 1,
      "start": 1
    },
    "status": {
      "rows": [
        {
          "count": 1,
          "key": "string"
        }
      ]
    },
    "summary": {
      "cached_in_tokens": 1,
      "duration_ms": 1,
      "error_rate": 1.1,
      "errors": 1,
      "in_tokens": 1,
      "out_tokens": 1,
      "p50_latency_ms": 1,
      "p95_latency_ms": 1,
      "requests": 1
    },
    "timeseries": {
      "bucket_ms": 1,
      "buckets": [
        {
          "cached_in_tokens": 1,
          "duration_ms": 1,
          "errors": 1,
          "in_tokens": 1,
          "out_tokens": 1,
          "p50_latency_ms": 1,
          "p95_latency_ms": 1,
          "requests": 1,
          "t0": 1,
          "t1": 1
        }
      ]
    },
    "tool_calls": {
      "rows": [
        {
          "count": 1,
          "key": "string"
        }
      ]
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.mixlayer.com/v1/organizations/org_id/analytics/overview"

querystring = {"group_by":"model","metric":"requests","range_end":"1","range_start":"1"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.mixlayer.com/v1/organizations/org_id/analytics/overview?group_by=model&metric=requests&range_end=1&range_start=1';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mixlayer.com/v1/organizations/org_id/analytics/overview?group_by=model&metric=requests&range_end=1&range_start=1"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.mixlayer.com/v1/organizations/org_id/analytics/overview?group_by=model&metric=requests&range_end=1&range_start=1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.mixlayer.com/v1/organizations/org_id/analytics/overview?group_by=model&metric=requests&range_end=1&range_start=1")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.mixlayer.com/v1/organizations/org_id/analytics/overview?group_by=model&metric=requests&range_end=1&range_start=1', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```