Overview
The Performance Dashboard API provides a RESTful interface for accessing agent performance metrics, cost analytics, and custom metric definitions. This API enables developers to programmatically monitor their AI agents, track spending, and define business-specific KPIs. Base URL:https://api.adenhq.com/v1/analytics
Authentication
All API requests require authentication via API key in the header:Data Models
Core Metric Types
Standard Metric Schema
Time Series Data Point
Percentile Distribution
Standard Metrics Catalog
Cost Metrics
| Metric ID | Name | Type | Unit | Description |
|---|---|---|---|---|
cost.total | Total Cost | counter | usd | Cumulative spend across all agents |
cost.daily | Daily Cost | timeseries | usd | Cost aggregated by day |
cost.by_model | Cost by Model | gauge | usd | Spend breakdown by model |
cost.by_agent | Cost by Agent | gauge | usd | Spend breakdown by agent |
cost.per_completion | Cost per Completion | gauge | usd | Average cost per successful completion |
cost.cache_savings | Cache Savings | counter | usd | Money saved via prompt caching |
cost.burn_rate | Budget Burn Rate | gauge | percent | Current spend rate vs. budget |
Usage Metrics
| Metric ID | Name | Type | Unit | Description |
|---|---|---|---|---|
usage.requests.total | Total Requests | counter | count | Total API requests |
usage.requests.daily | Daily Requests | timeseries | count | Requests aggregated by day |
usage.tokens.total | Total Tokens | counter | tokens | Total tokens consumed |
usage.tokens.input | Input Tokens | counter | tokens | Prompt/input tokens |
usage.tokens.output | Output Tokens | counter | tokens | Completion/output tokens |
Performance Metrics
| Metric ID | Name | Type | Unit | Description |
|---|---|---|---|---|
perf.latency.avg | Average Latency | gauge | ms | Mean response time |
perf.latency.distribution | Latency Distribution | histogram | ms | Full latency percentiles |
perf.latency.p50 | Latency P50 | gauge | ms | Median latency |
perf.latency.p95 | Latency P95 | gauge | ms | 95th percentile latency |
perf.latency.p99 | Latency P99 | gauge | ms | 99th percentile latency |
Autonomy Metrics
| Metric ID | Name | Type | Unit | Description |
|---|---|---|---|---|
autonomy.intervention_rate | Intervention Rate | gauge | percent | Sessions requiring human handoff |
autonomy.goal_completion_rate | Goal Completion Rate | gauge | percent | Sessions achieving business intent |
autonomy.steps_to_resolution | Steps to Resolution | gauge | count | Avg turns to solve a problem |
autonomy.self_correction_rate | Self-Correction Rate | gauge | percent | Errors auto-recovered without human |
autonomy.deflection_rate | Deflection Rate | gauge | percent | Requests resolved without human |
Quality Metrics
| Metric ID | Name | Type | Unit | Description |
|---|---|---|---|---|
quality.tool_success_rate | Tool Usage Success Rate | gauge | percent | Successful tool/API calls |
quality.hallucination_rate | Hallucination Rate | gauge | percent | Responses not grounded in context |
quality.loop_rate | Loop Rate | gauge | percent | Sessions with repeated actions |
quality.sentiment_shift | Sentiment Shift | gauge | score | Change in user sentiment (-1 to +1) |
API Endpoints
1. Get Single Metric (Point-in-Time)
Retrieve the current value of a specific metric.| Parameter | Type | Required | Description |
|---|---|---|---|
metric_id | string | Yes | The metric identifier (e.g., cost.total) |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
at | string | No | now | ISO 8601 timestamp for point-in-time query |
agent_id | string | No | all | Filter by specific agent |
model | string | No | all | Filter by model (e.g., claude-sonnet-4-5-20250929) |
customer_id | string | No | all | Filter by end-customer (multi-tenant) |
2. Get Metric Time Series
Retrieve metric values over a time range.| Parameter | Type | Required | Description |
|---|---|---|---|
metric_id | string | Yes | The metric identifier |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
start | string | Yes | — | Start of time range (ISO 8601) |
end | string | No | now | End of time range (ISO 8601) |
granularity | string | No | auto | minute, hour, day, week, month |
aggregation | string | No | sum | Aggregation method for the granularity |
agent_id | string | No | all | Filter by agent |
model | string | No | all | Filter by model |
customer_id | string | No | all | Filter by end-customer |
group_by | string | No | none | Dimension to group by: agent_id, model, customer_id |
limit | integer | No | 1000 | Max data points returned |
3. Get Percentile Distribution
Retrieve distribution data for histogram-type metrics.| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
start | string | Yes | — | Start of time range |
end | string | No | now | End of time range |
agent_id | string | No | all | Filter by agent |
model | string | No | all | Filter by model |
buckets | integer | No | 20 | Number of histogram buckets |
4. Batch Get Metrics
Retrieve multiple metrics in a single request.5. Get Dashboard Summary
Retrieve all KPIs for dashboard rendering.| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
period | string | No | 30d | Predefined period: 24h, 7d, 30d, 90d, ytd |
start | string | No | — | Custom start (overrides period) |
end | string | No | now | Custom end |
agent_id | string | No | all | Filter by agent |
customer_id | string | No | all | Filter by customer |
Custom Metrics API
Custom metrics allow developers to define business-specific KPIs using formulas based on standard metrics.Custom Metric Schema
6. List Custom Metrics
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
is_active | boolean | No | all | Filter by active status |
limit | integer | No | 50 | Max results |
offset | integer | No | 0 | Pagination offset |
7. Get Custom Metric Definition
8. Create Custom Metric
9. Update Custom Metric
10. Delete Custom Metric
11. Evaluate Custom Metric
Query the calculated value of a custom metric.start, end, granularity, etc.)
Response:
12. Validate Custom Metric Formula
Test a formula before creating a metric.Formula Expression Language
Custom metrics use a simple expression language for calculations.Supported Operators
| Operator | Description | Example |
|---|---|---|
+ | Addition | $a + $b |
- | Subtraction | $a - $b |
* | Multiplication | $a * $b |
/ | Division | $a / $b |
% | Modulo | $a % $b |
^ | Power | $a ^ 2 |
() | Grouping | ($a + $b) / $c |
Built-in Functions
| Function | Description | Example |
|---|---|---|
abs(x) | Absolute value | abs($a - $b) |
min(a, b) | Minimum of two values | min($a, $b) |
max(a, b) | Maximum of two values | max($a, $b) |
round(x, n) | Round to n decimals | round($a / $b, 2) |
if(cond, then, else) | Conditional | if($b > 0, $a / $b, 0) |
coalesce(a, b) | First non-null | coalesce($a, 0) |
Example Formulas
Efficiency Score (composite):Webhooks & Alerts (Future)
Alert Rule Schema
Error Responses
All errors follow a consistent format:Error Codes
| HTTP Status | Error Type | Description |
|---|---|---|
| 400 | invalid_request_error | Malformed request or invalid parameters |
| 401 | authentication_error | Invalid or missing API key |
| 403 | permission_error | Insufficient permissions for resource |
| 404 | not_found_error | Metric or resource not found |
| 409 | conflict_error | Resource already exists (duplicate ID) |
| 429 | rate_limit_error | Too many requests |
| 500 | api_error | Internal server error |
Rate Limits
| Endpoint Category | Requests per Minute |
|---|---|
| Read (GET) | 300 |
| Write (POST/PATCH/DELETE) | 60 |
| Batch operations | 30 |