Skip to main content
The Analytics API provides programmatic access to organization-level usage data for Factory. Query Factory Standard Credits consumption, tool invocations, user activity, and productivity metrics across your entire organization.

Quick Start


Authentication

All requests require a Factory API key in the Authorization header:
Generate API keys at app.factory.ai/settings/api-keys.

Permissions

Only users with Manager or Owner roles can access the Analytics API. Members and guests will receive a 403 error.

Base URL


Response Format

All responses follow a consistent envelope structure:

Endpoints

The Analytics API provides five endpoints, each focused on a specific category of metrics:

Understanding group_by

Several endpoints support a group_by parameter. Here’s how it works:
  • Without group_by: Returns one row per day with nested breakdowns (e.g., by_tool, daily_active_users_by_client). Use this when you want all dimensions in a single response.
  • With group_by: Flattens one of those nested arrays into separate rows. Each row has a group_key field identifying the dimension value. Use this when piping data into tools that expect flat rows (spreadsheets, BI tools, time-series databases).
For example, /activity without group_by returns daily_active_users_by_client as an object. With group_by=client, you get separate rows for terminal-ui, web, and non-interactive-cli - useful for plotting each client type as its own line on a chart.

Factory Standard Credits Usage

Returns daily Factory Standard Credits consumption across your organization.

Query Parameters

Response Fields

Example


Tool Usage

Returns daily tool invocations, MCP usage, skills, slash commands, and autonomy metrics.

Query Parameters

Response

Response Fields

Grouped Response

When group_by=tool_name, returns one row per tool per day inside data:

User Activity

Returns daily, weekly, and monthly active users along with session counts.

Query Parameters

Response

Response Fields

Client Types

Grouped Response

When group_by=client, returns one row per client type per day inside data:

Productivity

Returns daily file operations and git activity.

Query Parameters

Response

Response Fields


Per-User Metrics

Returns detailed metrics per user with cursor-based pagination.

Query Parameters

Response

Response Fields

Delegation Levels

Pagination

Use cursor-based pagination to iterate through users:

Important Constraints

Date Requirements

  • Format: All dates must be YYYY-MM-DD
  • Timezone: UTC only (no timezone parameter)
  • Data availability: Data is available through yesterday (UTC). Requesting today’s date returns a 400 error.
  • Historical data: Available from January 14, 2026

Rate Limits

Rate limits vary by plan. Contact us for specifics or if you need higher limits for dashboard or automation use cases.

Error Handling

The API returns standard HTTP status codes:

Error Response Format


Data Pipeline

Analytics data flows through the following pipeline:
  • Source: OpenTelemetry spans from the CLI and daemon
  • Processing: Daily batch aggregation via dbt
  • Availability: Data is available the day after it’s generated

Data Quality Notes

A few known data quality considerations:
  • MCP server names: Some duplicates exist due to case sensitivity (e.g., axiom vs Axiom)
  • Tool names: Approximately 0.006% of entries contain parsing artifacts
  • User counts: A user active on multiple clients counts once in DAU but appears in each client breakdown

Use Cases

Cost Monitoring Dashboard

Track usage trends and identify cost drivers:

Adoption Tracking

Monitor DAU/WAU/MAU and identify adoption patterns:

Team Productivity Reports

Measure output and efficiency:

Individual Performance

Export per-user metrics for team leads: