Skip to main content
The Analytics API lets you retrieve workspace metrics programmatically using the same data that powers the in-app analytics dashboards. All queries are scoped to the workspace identified by your API key.
For interactive endpoint documentation with request/response examples, see the API reference.
Authentication follows the same API key mechanism used across all v1 endpoints — refer to the API reference for details.

Endpoint

GET /v1/analytics/{metric}

Path parameter

ParameterTypeDescription
metricstringThe analytics metric to retrieve. See Available Metrics for all valid values.

Query parameters

ParameterTypeRequiredDescription
time_startISO 8601 datetimeYesStart of the time range. Must include a timezone offset (e.g. 2026-01-01T00:00:00Z). Must be before time_end.
time_endISO 8601 datetimeYesEnd of the time range. Must include a timezone offset.
pageintegerNoPage number for paginated metrics (1-based).
page_sizeintegerNoNumber of items per page for paginated metrics. Default: 50. Max: 200.

Time range resolution

The API automatically adjusts aggregation granularity based on the requested range:
  • More than 3 days → daily buckets
  • 3 days or less → hourly buckets

Rate limits

5 requests per second per workspace.

Response format

All metrics return an AnalyticsResponse object with two fields:
FieldTypeDescription
typestringOne of simple, table, barchart, horizontal-barchart, or empty
valueobjectThe metric data. Shape depends on type (see below).

simple — a single scalar value

{
  "type": "simple",
  "value": {
    "value": 1234,
    "prefix": null,
    "suffix": " runs"
  }
}
FieldDescription
valueThe numeric or string value
prefixOptional string displayed before the value (e.g. "$")
suffixOptional string displayed after the value (e.g. " runs")

barchart — time-series data

{
  "type": "barchart",
  "value": {
    "values": [
      { "name": "2026-01-15", "values": { "runs": 42 }, "value_mapping": null },
      { "name": "2026-01-16", "values": { "runs": 37 }, "value_mapping": null }
    ]
  }
}
Each item in values represents one time bucket. The keys inside values are metric-specific series names.

table — tabular summary

{
  "type": "table",
  "value": {
    "headings": ["Model", "Tokens", "Cost"],
    "rows": [
      { "Model": "gpt-4o", "Tokens": 50000, "Cost": 0.25 }
    ],
    "prefixes": { "Cost": "$" },
    "suffixes": null
  }
}

horizontal-barchart — ranked distribution

Same shape as table, displayed as a horizontal bar chart in the UI.

empty

Returned when there is no data for the requested time range.

Error responses

400 — invalid time range
{ "detail": "time_start must be before time_end" }
422 — validation error (e.g. page_size out of bounds)
{
  "detail": [
    {
      "loc": ["query", "page_size"],
      "msg": "ensure this value is less than or equal to 200",
      "type": "value_error.number.not_le"
    }
  ]
}
429 — rate limit exceeded
{ "detail": "Rate limit exceeded" }

Available metrics

Execution metrics

MetricResponse typeDescription
flow_runssimpleTotal flow executions in the time range
trigger_runssimpleExecutions initiated by triggers
manual_runssimpleExecutions initiated manually (editor or API)
agent_runssimpleExecutions initiated by agents
active_userssimpleDistinct users who ran flows
active_runssimpleFlows currently executing (live count)
active_triggerssimpleCurrently enabled triggers
errorssimpleNumber of failed runs
average_run_timesimpleMean flow execution duration
flow_runs_distributionbarchartRun count over time, split by source (manual, trigger, agent)
flow_per_usertableRun count per user
errors_over_timebarchartFailed runs over time
run_time_over_timebarchartExecution duration over time (P25, P50, P90 percentiles)

Cost & token metrics

MetricResponse typeDescription
ai_models_total_costsimpleEstimated total LLM cost across all models
ai_models_total_tokenssimpleTotal tokens consumed across all models
average_cost_per_runsimpleMean estimated cost per flow execution
tokens_costtableTokens and estimated cost grouped by LLM model
tokens_cost_by_workflowtableTokens and estimated cost per workflow
tokens_cost_by_usertableTokens and estimated cost per user
tokens_cost_by_nodetableTokens and estimated cost per node
model_tokens_total_costsimpleEstimated total cost (non-cached tokens only)
ai_operations_per_tooltableAI operation count grouped by tool type (flow, agent, KB)
model_tokens_per_tooltableToken usage grouped by tool type
ai_operations_per_usertableAI operation count per user
model_tokens_per_usertableToken usage per user
Costs are estimates based on publicly available model pricing. Cached LLM responses are excluded from cost calculations.

Conversation metrics

MetricResponse typeDescription
conversations_startedsimpleTotal conversations initiated
messages_sentsimpleTotal messages sent (user + agent)
messages_per_conversationsimpleAverage messages per conversation
conversation_userssimpleDistinct users who started conversations
conversations_started_over_timebarchartConversations started over time
messages_sent_over_timebarchartMessages sent over time
conversations_started_by_usertableConversations started per user
messages_sent_by_usertableMessages sent per user
conversation_tokens_costtableToken usage and cost per LLM model for conversations
conversation_tokens_cost_by_usertableConversation token usage and cost per user
conversation_chat_costs_totalsimpleEstimated total cost of all conversation LLM calls

API usage metrics

MetricResponse typeDescription
api_calls_per_datebarchartAPI calls made per day/hour
api_calls_per_endpointtableAPI call count grouped by endpoint
api_calls_logtable (paginated)Detailed log of recent API calls with endpoint, method, response code, and duration

Knowledge base metrics

MetricResponse typeDescription
kb_total_documentssimpleTotal documents across all knowledge bases
kb_processed_successfullysimpleDocuments successfully ingested and indexed
kb_failed_documentssimpleDocuments that failed ingestion
kb_contributorssimpleDistinct users who uploaded documents
kb_documents_over_timebarchartDocument ingestion count over time
kb_documents_per_kbtableDocument count per knowledge base
kb_documents_by_usertableDocument count per user
kb_document_typestableDocument count grouped by file type (PDF, Word, Excel, etc.)
kb_user_activitytablePer-user breakdown of upload activity
kb_overviewtableSummary table across all knowledge bases

Examples

Total flow runs for January 2026

curl -X GET \
  "https://api.noxus.ai/v1/analytics/flow_runs?time_start=2026-01-01T00:00:00Z&time_end=2026-01-31T23:59:59Z" \
  -H "X-API-Key: your_api_key_here"
Response:
{
  "type": "simple",
  "value": {
    "value": 1842,
    "prefix": null,
    "suffix": " runs"
  }
}

LLM token usage by model (last 7 days)

curl -X GET \
  "https://api.noxus.ai/v1/analytics/tokens_cost?time_start=2026-02-20T00:00:00Z&time_end=2026-02-27T23:59:59Z" \
  -H "X-API-Key: your_api_key_here"
Response:
{
  "type": "table",
  "value": {
    "headings": ["Model", "Tokens", "Cost"],
    "rows": [
      { "Model": "gpt-4o", "Tokens": 250000, "Cost": 1.25 },
      { "Model": "claude-3-5-sonnet", "Tokens": 180000, "Cost": 0.54 }
    ],
    "prefixes": { "Cost": "$" },
    "suffixes": null
  }
}

Paginated API call log

curl -X GET \
  "https://api.noxus.ai/v1/analytics/api_calls_log?time_start=2026-02-01T00:00:00Z&time_end=2026-02-27T23:59:59Z&page=1&page_size=20" \
  -H "X-API-Key: your_api_key_here"
Response:
{
  "type": "table",
  "value": {
    "headings": ["Endpoint", "Method", "Status", "Duration"],
    "items": [
      { "Endpoint": "/v1/workflows/{id}/runs", "Method": "POST", "Status": 200, "Duration": "142ms" }
    ],
    "total": 1560,
    "pages": 78,
    "size": 20,
    "page": 1
  }
}