Skip to Content

Get metrics by dimension

POSThttps://api.respan.ai/api/dashboard/time-series/breakdown/

Returns time-series metrics grouped by a dimension. Span scope supports full filtering and dimensions. Trace scope accepts no body filters and only user or organization-key breakdowns. Thread scope accepts neither filters nor a breakdown dimension. Each requested metric is a top-level key containing an array of time buckets.

Servers

https://api.respan.ai: Respan API Server

Authentication

RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: bearer; format: Respan API key.

HTTP
Authorization: Bearer $RESPAN_API_KEY

Or:

DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: bearer; format: Dashboard JWT.

HTTP
Authorization: Bearer $RESPAN_DASHBOARD_JWT

Query parameters

Parameter Type Required Description and constraints
summary_type string Optional
Preset time range. Use this or explicit start_time / end_time.
Allowed: "daily", "weekly", "monthly", "quarterly", "yearly", "last_24h", "all"
Default: all
date string Optional
Base date used with summary_type presets.
Format: date
start_time string Optional
Optional explicit ISO start time.
Format: date-time
end_time string Optional
Optional explicit ISO end time.
Format: date-time
time_tick string Optional
Bucket granularity for time-series responses.
Allowed: "minute", "hour", "day"
Default: hour
timezone_offset number Optional
Timezone offset, in hours, used when resolving preset ranges.
Default: 0
breakdown_by string Optional
Dimension to break the time series down by.
Allowed: "model", "organization_key_id", "customer_identifier", "custom_identifier", "prompt_id", "deployment_id", "deployment_name", "provider_id"
Default: model
scope string Optional
Aggregation unit.
Allowed: "span", "trace", "thread"
Default: span

Request body

The request body is optional.

application/json

Field Type Requirement Description and constraints
$ object and object Optional body
-
$ (allOf 1) object Schema variant
Optional POST body. Only filters is read from the body; time range controls are URL query parameters.
Reference: #/components/schemas/DashboardFiltersRequest
$ (allOf 1).filters object Optional
Narrows the spans the metrics are computed from.

Each key is a field to filter on, and each value is a condition: {"<field>": {"operator": "<operator>", "value": [...]}}. A span must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.

Operators: "" (equals, the default), not, in, not_in, lt, lte, gt, gte, contains, not_contains, icontains (ignores case), startswith, not_startswith, endswith, not_endswith, empty, not_empty. Put values in a list: "" and in match any of the listed values, and not and not_in match none of them. Other operators take one value; for empty and not_empty, send [""].

Fields: span columns, such as model, provider_id, deployment_name, customer_identifier, custom_identifier, organization_key_id, prompt_id, log_type, status_code, environment, cost, latency, prompt_tokens, completion_tokens and total_request_tokens, plus metadata__<key> (values are strings). Aliases such as total_tokens and total_cost, and scores__<evaluator_id>, don’t work here.

Example:

json<br />{<br /> "model": {"operator": "", "value": ["gpt-5.5"]},<br /> "customer_identifier": {"operator": "", "value": ["alex@acme.dev"]}<br />}<br />
Reference: #/components/schemas/Filters
Example: {"customer_identifier":{"operator":"","value":["alex@acme.dev"]}}
$ (allOf 1).filters.status object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.status.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.status.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.status.value[] any Array item
-
$ (allOf 1).filters.status_code object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.status_code.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.status_code.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.status_code.value[] any Array item
-
$ (allOf 1).filters.unique_id object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.unique_id.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.unique_id.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.unique_id.value[] any Array item
-
$ (allOf 1).filters.customer_identifier object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.customer_identifier.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.customer_identifier.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.customer_identifier.value[] any Array item
-
$ (allOf 1).filters.thread_identifier object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.thread_identifier.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.thread_identifier.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.thread_identifier.value[] any Array item
-
$ (allOf 1).filters.custom_identifier object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.custom_identifier.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.custom_identifier.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.custom_identifier.value[] any Array item
-
$ (allOf 1).filters.group_identifier object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.group_identifier.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.group_identifier.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.group_identifier.value[] any Array item
-
$ (allOf 1).filters.prompt_id object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.prompt_id.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.prompt_id.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.prompt_id.value[] any Array item
-
$ (allOf 1).filters.trace_unique_id object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.trace_unique_id.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.trace_unique_id.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.trace_unique_id.value[] any Array item
-
$ (allOf 1).filters.span_parent_id object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.span_parent_id.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.span_parent_id.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.span_parent_id.value[] any Array item
-
$ (allOf 1).filters.is_root_span object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.is_root_span.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.is_root_span.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.is_root_span.value[] any Array item
-
$ (allOf 1).filters.span_workflow_name object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.span_workflow_name.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.span_workflow_name.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.span_workflow_name.value[] any Array item
-
$ (allOf 1).filters.span_name object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.span_name.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.span_name.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.span_name.value[] any Array item
-
$ (allOf 1).filters.model object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.model.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.model.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.model.value[] any Array item
-
$ (allOf 1).filters.log_type object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.log_type.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.log_type.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.log_type.value[] any Array item
-
$ (allOf 1).filters.stream object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.stream.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.stream.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.stream.value[] any Array item
-
$ (allOf 1).filters.has_tool_calls object Optional
Whether the span made tool calls.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.has_tool_calls.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.has_tool_calls.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.has_tool_calls.value[] any Array item
-
$ (allOf 1).filters.cache_bit object Optional
Whether the response was served from the Respan cache.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.cache_bit.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.cache_bit.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.cache_bit.value[] any Array item
-
$ (allOf 1).filters.cache_key object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.cache_key.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.cache_key.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.cache_key.value[] any Array item
-
$ (allOf 1).filters.prompt_tokens object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.prompt_tokens.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.prompt_tokens.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.prompt_tokens.value[] any Array item
-
$ (allOf 1).filters.completion_tokens object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.completion_tokens.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.completion_tokens.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.completion_tokens.value[] any Array item
-
$ (allOf 1).filters.total_tokens object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.total_tokens.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.total_tokens.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.total_tokens.value[] any Array item
-
$ (allOf 1).filters.cost object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.cost.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.cost.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.cost.value[] any Array item
-
$ (allOf 1).filters.latency object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.latency.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.latency.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.latency.value[] any Array item
-
$ (allOf 1).filters.positive_feedback object Optional
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.positive_feedback.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.positive_feedback.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.positive_feedback.value[] any Array item
-
$ (allOf 1).filters.<key> object Map value
A filter condition with an operator and value.
Reference: #/components/schemas/FilterValue
$ (allOf 1).filters.<key>.operator string Optional
Comparison operator. An empty string means equals.
Allowed: "", "not", "in", "not_in", "lt", "lte", "gt", "gte", "contains", "not_contains", "icontains", "startswith", "not_startswith", "endswith", "not_endswith", "empty", "not_empty"
Default: “
Example: "gte"
$ (allOf 1).filters.<key>.value array<any> Required in parent
Value(s) to filter by.
Example: [0.01]
$ (allOf 1).filters.<key>.value[] any Array item
-
$ (allOf 2) object Schema variant
-
$ (allOf 2).metrics_to_aggregate array<string> Optional
Metrics to return. Supported values depend on scope; when omitted the API returns number of requests, total cost, and total tokens.
$ (allOf 2).metrics_to_aggregate[] string Array item
Allowed: "number_of_requests", "total_cost", "total_tokens", "error_count", "error_percentage", "average_cost", "average_tokens", "cache_hit_percentage", "average_latency", "average_ttft", "average_tps"

OpenAPI request schema

{
  "allOf": [
    {
      "$ref": "#/components/schemas/DashboardFiltersRequest"
    },
    {
      "type": "object",
      "properties": {
        "metrics_to_aggregate": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "number_of_requests",
              "total_cost",
              "total_tokens",
              "error_count",
              "error_percentage",
              "average_cost",
              "average_tokens",
              "cache_hit_percentage",
              "average_latency",
              "average_ttft",
              "average_tps"
            ]
          },
          "description": "Metrics to return. Supported values depend on `scope`; when omitted the API returns number of requests, total cost, and total tokens."
        }
      }
    }
  ]
}

Responses

200

Metric-keyed time-series breakdown.

application/json

Field Type Requirement Description and constraints
$ object Body
-
$.<key> array<object> or object Map value
A metric’s time buckets, one row per bucket. A non-metric key can hold a map of strings instead.
Reference: #/components/schemas/DashboardBreakdownValue
$.<key> (oneOf 1) array<object> Schema variant
-
$.<key> (oneOf 1)[] object Array item
One time bucket. Contains date_group and one key per dimension value (e.g. one column per model) with the metric value as the cell. Other dimension values may be folded into Others.
Reference: #/components/schemas/DashboardBreakdownRow
Additional properties are allowed
$.<key> (oneOf 1)[].date_group string Required in parent
Format: date-time
$.<key> (oneOf 2) object Schema variant
-
$.<key> (oneOf 2).<key> string Map value
-

OpenAPI response schema

{
  "type": "object",
  "additionalProperties": {
    "$ref": "#/components/schemas/DashboardBreakdownValue"
  }
}

400

Invalid scope, dimension, filters, or metric combination.

application/json

Field Type Requirement Description and constraints
$ object Body
-
error string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "string"
    }
  }
}
Example
JSON
{ "error": "Not supported scope value. Supported: ['span', 'thread', 'trace']" }

403

The API key is missing, invalid or expired.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "Your API key is invalid or expired, please check your API key in the platform settings." }

413

The query exceeded a memory or execution-time resource limit.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Optional
-

OpenAPI response schema

{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "This query is too large to run — it exceeded a per-query resource limit. Narrow the time range or add filters, then try again." }

OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

OpenAPI operation

{
  "summary": "Get metrics by dimension",
  "operationId": "listMetricsBreakdown",
  "tags": [
    "Dashboard"
  ],
  "description": "Returns time-series metrics grouped by a dimension. Span scope supports full filtering and dimensions. Trace scope accepts no body filters and only user or organization-key breakdowns. Thread scope accepts neither filters nor a breakdown dimension. Each requested metric is a top-level key containing an array of time buckets.",
  "parameters": [
    {
      "name": "summary_type",
      "in": "query",
      "schema": {
        "type": "string",
        "enum": [
          "daily",
          "weekly",
          "monthly",
          "quarterly",
          "yearly",
          "last_24h",
          "all"
        ],
        "default": "all"
      },
      "description": "Preset time range. Use this or explicit `start_time` / `end_time`."
    },
    {
      "name": "date",
      "in": "query",
      "schema": {
        "type": "string",
        "format": "date"
      },
      "description": "Base date used with `summary_type` presets."
    },
    {
      "name": "start_time",
      "in": "query",
      "schema": {
        "type": "string",
        "format": "date-time"
      },
      "description": "Optional explicit ISO start time."
    },
    {
      "name": "end_time",
      "in": "query",
      "schema": {
        "type": "string",
        "format": "date-time"
      },
      "description": "Optional explicit ISO end time."
    },
    {
      "name": "time_tick",
      "in": "query",
      "schema": {
        "type": "string",
        "enum": [
          "minute",
          "hour",
          "day"
        ],
        "default": "hour"
      },
      "description": "Bucket granularity for time-series responses."
    },
    {
      "name": "timezone_offset",
      "in": "query",
      "schema": {
        "type": "number",
        "default": 0
      },
      "description": "Timezone offset, in hours, used when resolving preset ranges."
    },
    {
      "name": "breakdown_by",
      "in": "query",
      "schema": {
        "type": "string",
        "enum": [
          "model",
          "organization_key_id",
          "customer_identifier",
          "custom_identifier",
          "prompt_id",
          "deployment_id",
          "deployment_name",
          "provider_id"
        ],
        "default": "model"
      },
      "description": "Dimension to break the time series down by."
    },
    {
      "name": "scope",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "span",
          "trace",
          "thread"
        ],
        "default": "span"
      },
      "description": "Aggregation unit."
    }
  ],
  "requestBody": {
    "required": false,
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "$ref": "#/components/schemas/DashboardFiltersRequest"
            },
            {
              "type": "object",
              "properties": {
                "metrics_to_aggregate": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "number_of_requests",
                      "total_cost",
                      "total_tokens",
                      "error_count",
                      "error_percentage",
                      "average_cost",
                      "average_tokens",
                      "cache_hit_percentage",
                      "average_latency",
                      "average_ttft",
                      "average_tps"
                    ]
                  },
                  "description": "Metrics to return. Supported values depend on `scope`; when omitted the API returns number of requests, total cost, and total tokens."
                }
              }
            }
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Metric-keyed time-series breakdown.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/DashboardBreakdownValue"
            }
          }
        }
      }
    },
    "400": {
      "description": "Invalid scope, dimension, filters, or metric combination.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "string"
              }
            }
          },
          "example": {
            "error": "Not supported scope value. Supported: ['span', 'thread', 'trace']"
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "413": {
      "description": "The query exceeded a memory or execution-time resource limit.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "This query is too large to run — it exceeded a per-query resource limit. Narrow the time range or add filters, then try again."
          }
        }
      }
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}

OpenAPI path metadata

{}

Referenced OpenAPI components

{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "schemas": {
    "DashboardBreakdownRow": {
      "type": "object",
      "description": "One time bucket. Contains `date_group` and one key per dimension value (e.g. one column per model) with the metric value as the cell. Other dimension values may be folded into `Others`.",
      "properties": {
        "date_group": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": true,
      "required": [
        "date_group"
      ]
    },
    "DashboardBreakdownValue": {
      "description": "A metric's time buckets, one row per bucket. A non-metric key can hold a map of strings instead.",
      "oneOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/DashboardBreakdownRow"
          }
        },
        {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      ]
    },
    "DashboardFiltersRequest": {
      "type": "object",
      "description": "Optional POST body. Only `filters` is read from the body; time range controls are URL query parameters.",
      "properties": {
        "filters": {
          "$ref": "#/components/schemas/Filters",
          "description": "Narrows the spans the metrics are computed from.\n\nEach key is a field to filter on, and each value is a condition: `{\"<field>\": {\"operator\": \"<operator>\", \"value\": [...]}}`. A span must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.\n\n**Operators:** `\"\"` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `\"\"` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[\"\"]`.\n\n**Fields:** span columns, such as `model`, `provider_id`, `deployment_name`, `customer_identifier`, `custom_identifier`, `organization_key_id`, `prompt_id`, `log_type`, `status_code`, `environment`, `cost`, `latency`, `prompt_tokens`, `completion_tokens` and `total_request_tokens`, plus `metadata__<key>` (values are strings). Aliases such as `total_tokens` and `total_cost`, and `scores__<evaluator_id>`, don't work here.\n\n**Example:**\n\n```json\n{\n  \"model\": {\"operator\": \"\", \"value\": [\"gpt-5.5\"]},\n  \"customer_identifier\": {\"operator\": \"\", \"value\": [\"alex@acme.dev\"]}\n}\n```"
        }
      }
    },
    "FilterValue": {
      "type": "object",
      "description": "A filter condition with an operator and value.",
      "required": [
        "value"
      ],
      "properties": {
        "operator": {
          "type": "string",
          "description": "Comparison operator. An empty string means equals.",
          "enum": [
            "",
            "not",
            "in",
            "not_in",
            "lt",
            "lte",
            "gt",
            "gte",
            "contains",
            "not_contains",
            "icontains",
            "startswith",
            "not_startswith",
            "endswith",
            "not_endswith",
            "empty",
            "not_empty"
          ],
          "default": "",
          "example": "gte"
        },
        "value": {
          "type": "array",
          "description": "Value(s) to filter by.",
          "items": {},
          "example": [
            0.01
          ]
        }
      }
    },
    "Filters": {
      "type": "object",
      "description": "Each key is a field to filter on, and each value is a condition: `{\"<field>\": {\"operator\": \"<operator>\", \"value\": [...]}}`. A result must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.\n\n**Operators:** `\"\"` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `\"\"` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[\"\"]`.\n\nThe fields you can filter on depend on the endpoint; `metadata__<key>` filters custom metadata where the endpoint supports it.",
      "properties": {
        "status": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "status_code": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "unique_id": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "customer_identifier": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "thread_identifier": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "custom_identifier": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "group_identifier": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "prompt_id": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "trace_unique_id": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "span_parent_id": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "is_root_span": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "span_workflow_name": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "span_name": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "model": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "log_type": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "stream": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "has_tool_calls": {
          "$ref": "#/components/schemas/FilterValue",
          "description": "Whether the span made tool calls."
        },
        "cache_bit": {
          "$ref": "#/components/schemas/FilterValue",
          "description": "Whether the response was served from the Respan cache."
        },
        "cache_key": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "prompt_tokens": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "completion_tokens": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "total_tokens": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "cost": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "latency": {
          "$ref": "#/components/schemas/FilterValue"
        },
        "positive_feedback": {
          "$ref": "#/components/schemas/FilterValue"
        }
      },
      "example": {
        "customer_identifier": {
          "operator": "",
          "value": [
            "alex@acme.dev"
          ]
        }
      },
      "additionalProperties": {
        "$ref": "#/components/schemas/FilterValue"
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}