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.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.
- Go to app.devin.ai > Settings > Service Users
- Click Create Service User and assign it a role with
ViewAccountMetricsandManageBillingpermissions — these are needed to read session metrics and consumption data - Copy the API token shown after creation — it’s only displayed once
- Store the token as a Secret named
DEVIN_SERVICE_USER_TOKENso Devin can use it during the session without hardcoding it
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.
What Devin builds
Devin reads the v3 API docs via the docs MCP to learn the exact request formats, then scaffolds the app:
- 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 - Creates API routes — Builds Next.js API routes that proxy requests to
https://api.devin.ai/v3/enterprise/*using the service user token from theDEVIN_SERVICE_USER_TOKENsecret - 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/organizationsendpoint - A per-user breakdown from
/consumption/daily/users - A sessions table from the sessions list endpoint with status, duration, and ACU cost
- Adds filtering — Wires up a date range picker that re-fetches all endpoints with updated
start_dateandend_dateparams - Opens a PR — Pushes the app with a
README.mdcovering environment variables, local dev setup (npm run dev), and deployment to Vercel
