The v2 APIs are in alpha and subject to change at any time.
Overview
Analytics API v2 is the next generation of the Devin Desktop Analytics API. It exposes consumption
analytics (credits and ACUs) through clean REST endpoints with query-parameter filtering, flexible
grouping, cursor-based pagination, and response caching.
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.
| v1 Analytics API | v2 Analytics API |
|---|
| Transport | POST with a JSON request body | GET with query parameters |
| Auth | service_key field in the request body | Authorization: Bearer <service_key> header |
| Permission | Varies per endpoint | Analytics Read |
| Pagination | None | Cursor-based (next_page_cursor / page_cursor) |
| Caching | None | ETag + If-None-Match (304 Not Modified) |
Authentication
v2 uses Bearer token authentication. Pass your service key in the Authorization header instead
of in the request body:
Authorization: Bearer <your_service_key>
The service key must have the Analytics Read permission.
Creating a service key
- 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
Authorization header
Keep your service keys secure and never expose them in client-side code or public repositories.
Group-scoped service keys are supported — when a key is scoped to a group, results are automatically
limited to that group.
Available endpoints
| Endpoint | Description |
|---|
Get Consumption (GET /api/v2alpha/analytics/consumption) | Query credit or ACU consumption with filtering, grouping, granularity, and pagination |
Get Active Users (GET /api/v2alpha/analytics/active-users) | Count distinct active users, optionally by day/month or per user |
Billing strategy
Responses adapt to your team’s billing strategy, reported in metadata.billing_strategy:
CREDITS — rows include prompt_credits and flex_credits
ACU — rows include billed_acus
The message_count field is always returned regardless of strategy.
List responses are paginated. When more data is available, the response includes a
pagination.next_page_cursor; pass it back as the page_cursor query parameter to fetch the next
page. Cursors expire after 24 hours.
Caching
Responses include an ETag header. Send it back in the If-None-Match header on subsequent requests
to receive a 304 Not Modified when the data is unchanged.
Rate limits
These endpoints are not intended for real-time usage monitoring. Data is hourly-aggregated and
the rate limit is low (10 requests per hour per team). Use them for periodic reporting and bulk
export, not live dashboards or per-request tracking.
v2 endpoints are rate-limited to 10 requests per hour per team. Exceeding the limit returns
429 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.