Skip to main content

Build a Custom API Usage Dashboard

Devin has a built-in usage dashboard, but if you need custom metrics or want to combine Devin data with other sources, have Devin build a tailored version using the v3 API.
AuthorCognition
CategoryData & Analytics
FeaturesAPI
1

Create a service user for API access

The v3 API authenticates with service user tokens, not personal API keys. You’ll need to create one before Devin can pull data.
  1. Go to app.devin.ai > Settings > Service Users
  2. Click Create Service User and assign it a role with ViewAccountMetrics and ManageBilling permissions — these are needed to read session metrics and consumption data
  3. Copy the API token shown after creation — it’s only displayed once
  4. Store the token as a Secret named DEVIN_SERVICE_USER_TOKEN so Devin can use it during the session without hardcoding it
For details on service user authentication, see the v3 API Authentication Guide.
2

Tell Devin what to build

Devin has native access to its own documentation through the Devin docs MCP — you don’t need to paste the API reference into the prompt. Just point Devin at the right endpoints and it will read the docs to learn request formats, query parameters, and response shapes.
3

What Devin builds

Devin reads the v3 API docs via the docs MCP to learn the exact request formats, then scaffolds the app:
  1. Reads the API docs — Searches the Devin docs MCP for the consumption and metrics endpoint schemas, learning query parameters like start_date, end_date, and response shapes
  2. Creates API routes — Builds Next.js API routes that proxy requests to https://api.devin.ai/v3/enterprise/* using the service user token from the DEVIN_SERVICE_USER_TOKEN secret
  3. Builds the dashboard UI — Creates a responsive dashboard page with Recharts, including:
    • KPI cards showing total sessions, ACUs consumed, and weekly active users
    • A time-series chart of daily consumption pulled from the /consumption/daily/organizations endpoint
    • A per-user breakdown from /consumption/daily/users
    • A sessions table from the sessions list endpoint with status, duration, and ACU cost
  4. Adds filtering — Wires up a date range picker that re-fetches all endpoints with updated start_date and end_date params
  5. Opens a PR — Pushes the app with a README.md covering environment variables, local dev setup (npm run dev), and deployment to Vercel
4

Extend the dashboard

Once the base dashboard is working, ask Devin to add more panels in follow-up messages: