> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Cascade Analytics

> Query Cascade-specific usage metrics including lines suggested/accepted, model usage, credit consumption, and tool usage statistics.

## Overview

Retrieve Cascade-specific analytics data including lines suggested/accepted, model usage, credit consumption, and tool usage statistics.

## Request

**service\_key** `string` *required*

Your service key with "Teams Read-only" permissions

**group\_name** `string`

Filter results to users in a specific group. Cannot be used with `emails` parameter.

**start\_timestamp** `string`

Start time in RFC 3339 format (e.g., `2023-01-01T00:00:00Z`)

**end\_timestamp** `string`

End time in RFC 3339 format (e.g., `2023-12-31T23:59:59Z`)

**emails** `array`

Array of email addresses to filter results. Cannot be used with `group_name` parameter.

**ide\_types** `array`

Filter by IDE type. Available options:

* `"editor"` - Devin Desktop Editor
* `"jetbrains"` - JetBrains Plugin
* `"cli"` - Devin CLI

If omitted, returns data for all IDEs.

> [!NOTE]
>
> When filtering by Devin CLI (`"cli"`), the `mode` field of `cascade_runs` is not populated. `cascade_lines` and `cascade_tool_usage` cover Devin CLI and Devin Local activity, but only include data recorded after those agents began reporting it.

**query\_requests** `array` *required*

Array of data source queries to execute. Each object should contain one of the supported data sources.

## Data Sources

### cascade\_lines

Query for daily Cascade lines suggested and accepted.

```json theme={null}
{
  "cascade_lines": {}
}
```

**Response Fields:**

* `day` - Date in RFC 3339 format
* `linesSuggested` - Number of lines suggested
* `linesAccepted` - Number of lines accepted

### cascade\_runs

Query for model usage, credit consumption, and mode data.

```json theme={null}
{
  "cascade_runs": {}
}
```

**Response Fields:**

* `day` - Date in RFC 3339 format
* `model` - Model name used
* `mode` - Cascade mode (see modes below)
* `messagesSent` - Number of messages sent
* `cascadeId` - Unique conversation ID
* `promptsUsed` - Credits consumed (in cents)

**Cascade Modes:**

* `CONVERSATIONAL_PLANNER_MODE_DEFAULT` - Write mode
* `CONVERSATIONAL_PLANNER_MODE_READ_ONLY` - Read mode
* `CONVERSATIONAL_PLANNER_MODE_PLANNING` - Planning mode (plans changes before implementing them)
* `CONVERSATIONAL_PLANNER_MODE_AUTO` - Auto mode (builds changes and validates them with automatic end-to-end testing)
* `CONVERSATIONAL_PLANNER_MODE_NO_TOOL` - Legacy mode
* `UNKNOWN` - Unknown mode

New modes may be added over time, so clients should handle mode values not listed here.

### cascade\_tool\_usage

Query for tool usage statistics (aggregate counts).

```json theme={null}
{
  "cascade_tool_usage": {}
}
```

**Response Fields:**

* `tool` - Tool identifier (see tool mappings below)
* `count` - Number of times tool was used

> [!NOTE]
>
> Per-user tool counts, and access with a Devin service user API key, are available from the v2
> [Get Tools](https://docs.devinenterprise.com/desktop/accounts/api-reference/get-tools.md) endpoint.

## Tool Usage Mappings

| Tool Identifier | Display Name |
| - | - |
| `CODE_ACTION` | Code Edit |
| `VIEW_FILE` | View File |
| `RUN_COMMAND` | Run Command |
| `FIND` | Find tool |
| `GREP_SEARCH` | Grep Search |
| `VIEW_FILE_OUTLINE` | View File Outline |
| `MQUERY` | Riptide |
| `WORKFLOWS_USED` | Workflows Used |
| `LIST_DIRECTORY` | List Directory |
| `MCP_TOOL` | MCP Tool |
| `PROPOSE_CODE` | Propose Code |
| `SEARCH_WEB` | Search Web |
| `MEMORY` | Memory |
| `PROXY_WEB_SERVER` | Browser Preview |
| `DEPLOY_WEB_APP` | Deploy Web App |

## Example Request

```bash theme={null}
curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here",
  "group_name": "engineering_team",
  "start_timestamp": "2025-01-01T00:00:00Z",
  "end_timestamp": "2025-01-02T00:00:00Z",
  "emails": ["user1@cognition.ai", "user2@cognition.ai"],
  "ide_types": ["editor"],
  "query_requests": [
    {
      "cascade_lines": {}
    },
    {
      "cascade_runs": {}
    },
    {
      "cascade_tool_usage": {}
    }
  ]
}' \
https://server.codeium.com/api/v1/CascadeAnalytics
```

## Response

**queryResults** `array`

Array of query results, one for each query request

**Cascade Lines Result**

**cascadeLines** `object`

**cascadeLines** `array`

Array of daily line statistics

**day** `string`

Date in RFC 3339 format

**linesSuggested** `string`

Number of lines suggested on this day

**linesAccepted** `string`

Number of lines accepted on this day

**Cascade Runs Result**

**cascadeRuns** `object`

**cascadeRuns** `array`

Array of model usage statistics

**day** `string`

Date in RFC 3339 format

**model** `string`

Model name used for the run

**mode** `string`

Cascade mode identifier. See Cascade Modes above for known values; clients should handle additional values.

**messagesSent** `string`

Number of messages sent

**cascadeId** `string`

Unique conversation identifier

**promptsUsed** `string`

Credits consumed in cents (e.g., "100" = 1 credit)

**Cascade Tool Usage Result**

**cascadeToolUsage** `object`

**cascadeToolUsage** `array`

Array of tool usage statistics

**tool** `string`

Tool identifier

**count** `string`

Number of times tool was used

### Example Response

```json theme={null}
{
  "queryResults": [
    {
      "cascadeLines": {
        "cascadeLines": [
          {
            "day": "2025-05-01T00:00:00Z",
            "linesSuggested": "206",
            "linesAccepted": "157"
          },
          {
            "day": "2025-05-02T00:00:00Z",
            "linesSuggested": "16"
          }
        ]
      }
    },
    {
      "cascadeRuns": {
        "cascadeRuns": [
          {
            "day": "2025-05-01T00:00:00Z",
            "model": "Claude 3.7 Sonnet (Thinking)",
            "mode": "CONVERSATIONAL_PLANNER_MODE_DEFAULT",
            "messagesSent": "1",
            "cascadeId": "0d35c1f7-0a85-41d0-ac96-a04cd2d64444"
          }
        ]
      }
    },
    {
      "cascadeToolUsage": {
        "cascadeToolUsage": [
          {
            "tool": "CODE_ACTION",
            "count": "15"
          },
          {
            "tool": "LIST_DIRECTORY",
            "count": "20"
          }
        ]
      }
    }
  ]
}
```

## Notes

* The API returns raw data which may contain "UNKNOWN" values
* For metrics analysis, aggregate by specific fields of interest (e.g., sum `promptsUsed` for usage patterns)
* Mode and prompt data may be split across multiple entries
* Credit consumption (`promptsUsed`) is returned in cents (100 = 1 credit)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.