Overview
Analytics API v2 is the next generation of the Devin Desktop Analytics API. It exposes consumption analytics (credits and ACUs), active users, and agent output (accepted lines of code) through clean REST endpoints with query-parameter filtering, flexible grouping, and cursor-based pagination.v2 endpoints are currently served under the
/api/v2alpha prefix while the API surface is
finalized. The base URL is https://server.codeium.com.What’s new in v2
The biggest change from v1 is authentication.Authentication
v2 uses Bearer token authentication. Pass your credential in theAuthorization header instead
of in the request body:
cog_ key you use for the Devin API) or a Windsurf service key.
Devin service user API keys
If you already manage Devin service users, you do not need separate Windsurf credentials:- Provision a service user under Settings > Devin API (Service users tab) for an organization, or Enterprise settings > Devin API (Service users tab) for the enterprise
- Assign it a custom role that includes the Use Local Analytics API permission (the built-in admin role already includes it)
- Copy the API key shown after provisioning — it starts with
cog_ - Use that key as the Bearer token
metadata.team_id is the
account’s Devin team identifier (devin-team$<account_id>).
The
group_id filter is a Windsurf teams concept and is not supported with Devin credentials —
requests that combine the two return 400 Bad Request.Windsurf service keys
- Navigate to your team settings page
- Go to the “Service Keys” section
- Create a new service key with the Analytics Read permission
- Use the key as a Bearer token in the
Authorizationheader
Available endpoints
Billing strategy
Consumption responses adapt to your team’s billing strategy, reported inmetadata.billing_strategy (output and active-user responses are unaffected):
CREDITS— rows includeprompt_creditsandflex_creditsACU— rows includebilled_acus
message_count (billing events) and user_message_count (user-sent messages, null for usage before 2026-04-11) fields are always returned regardless of strategy.
Pagination
List responses are paginated. When more data is available, the response includes apagination.next_page_cursor; pass it back as the page_cursor query parameter to fetch the next
page. Cursors expire after 24 hours.
Rate limits
v2 endpoints are rate-limited to 10 requests per hour per team. Exceeding the limit returns429 Too Many Requests with a Retry-After header.
Paginating an earlier query (following a next_page_cursor) does not count against the rate
limit — only the initial query for each report does. The low limit reflects that these endpoints are
for periodic reporting, not real-time monitoring.
