Skip to main content
POST
/
api
/
v1
/
CascadeAnalytics
Get Cascade Analytics
curl --request POST \
  --url https://server.codeium.com/api/v1/CascadeAnalytics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "service_key": "<string>",
  "group_name": "<string>",
  "start_timestamp": "<string>",
  "end_timestamp": "<string>",
  "emails": [
    {}
  ],
  "ide_types": [
    {}
  ],
  "query_requests": [
    {}
  ]
}
'
import requests

url = "https://server.codeium.com/api/v1/CascadeAnalytics"

payload = {
"service_key": "<string>",
"group_name": "<string>",
"start_timestamp": "<string>",
"end_timestamp": "<string>",
"emails": [{}],
"ide_types": [{}],
"query_requests": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
service_key: '<string>',
group_name: '<string>',
start_timestamp: '<string>',
end_timestamp: '<string>',
emails: [{}],
ide_types: [{}],
query_requests: [{}]
})
};

fetch('https://server.codeium.com/api/v1/CascadeAnalytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://server.codeium.com/api/v1/CascadeAnalytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'service_key' => '<string>',
'group_name' => '<string>',
'start_timestamp' => '<string>',
'end_timestamp' => '<string>',
'emails' => [
[

]
],
'ide_types' => [
[

]
],
'query_requests' => [
[

]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://server.codeium.com/api/v1/CascadeAnalytics"

payload := strings.NewReader("{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\",\n \"emails\": [\n {}\n ],\n \"ide_types\": [\n {}\n ],\n \"query_requests\": [\n {}\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://server.codeium.com/api/v1/CascadeAnalytics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\",\n \"emails\": [\n {}\n ],\n \"ide_types\": [\n {}\n ],\n \"query_requests\": [\n {}\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://server.codeium.com/api/v1/CascadeAnalytics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\",\n \"emails\": [\n {}\n ],\n \"ide_types\": [\n {}\n ],\n \"query_requests\": [\n {}\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "queryResults": [
    {
      "cascadeLines": {
        "cascadeLines": [
          {
            "day": "<string>",
            "linesSuggested": "<string>",
            "linesAccepted": "<string>"
          }
        ]
      },
      "cascadeRuns": {
        "cascadeRuns": [
          {
            "day": "<string>",
            "model": "<string>",
            "mode": "<string>",
            "messagesSent": "<string>",
            "cascadeId": "<string>",
            "promptsUsed": "<string>"
          }
        ]
      },
      "cascadeToolUsage": {
        "cascadeToolUsage": [
          {
            "tool": "<string>",
            "count": "<string>"
          }
        ]
      }
    }
  ]
}

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.
When filtering by Devin CLI ("cli"), only cascade_runs returns data. The cascade_lines and cascade_tool_usage data sources are not supported for Devin CLI and will return empty results.
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.
{
  "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.
{
  "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_NO_TOOL - Legacy mode
  • UNKNOWN - Unknown mode

cascade_tool_usage

Query for tool usage statistics (aggregate counts).
{
  "cascade_tool_usage": {}
}
Response Fields:
  • tool - Tool identifier (see tool mappings below)
  • count - Number of times tool was used

Tool Usage Mappings

Tool IdentifierDisplay Name
CODE_ACTIONCode Edit
VIEW_FILEView File
RUN_COMMANDRun Command
FINDFind tool
GREP_SEARCHGrep Search
VIEW_FILE_OUTLINEView File Outline
MQUERYRiptide
WORKFLOWS_USEDWorkflows Used
LIST_DIRECTORYList Directory
MCP_TOOLMCP Tool
PROPOSE_CODEPropose Code
SEARCH_WEBSearch Web
MEMORYMemory
PROXY_WEB_SERVERBrowser Preview
DEPLOY_WEB_APPDeploy Web App

Example Request

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

Example Response

{
  "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)