Count build token usage
Admin guide
Builders make apps with coding agents, and each session uses model tokens. Build token usage adds those tokens up per app, so Cost can show the token cost of building each one. The figure is what the same tokens would cost at each vendor’s published API prices. It is not what anyone paid: builders on seat plans aren’t charged per token, and it is never part of what Greenlight costs you.
It is off until an organization administrator turns it on, and it only counts sessions from then on.
What each agent needs
Section titled “What each agent needs”| Agent | How it is counted | What you set up |
|---|---|---|
| Claude Code | The Greenlight plugin adds up the session’s tokens on the builder’s machine when it ends and sends the counts. | Nothing beyond the switch. |
| Codex | The same as Claude Code. | Nothing beyond the switch. Each builder approves the plugin’s hook once in Codex, under /hooks. |
Cursor, in the editor or its cursor-agent command line |
Cursor keeps no token counts on the builder’s machine. The plugin tells your install which app each Cursor conversation belongs to, and your install reads that conversation’s counts from Cursor once an hour. | The switch, plus a Cursor team Admin API key. |
Claude Code and Codex send token counts per model, the app, and session times. For Cursor, the plugin sends the app, the conversation’s id, and session times, and your install reads the counts from Cursor. Everything goes only to your install. Prompts, conversations, and file paths never leave the builder’s machine, nothing goes to Shift, and no read shows one builder’s usage.
Turn it on
Section titled “Turn it on”- Open Settings → Organization as an organization administrator.
- In the Build token usage card, switch Report build token usage on. Claude Code and Codex sessions are counted from the next session that ends.
- If your builders use Cursor, add a Cursor Admin API key. The next section shows how.
Add a Cursor Admin API key
Section titled “Add a Cursor Admin API key”Cursor only shares per-request token counts through its team Admin API, so your install needs a key to read them.
- Create the key in Cursor. A Cursor team admin opens API Keys in the Cursor dashboard and creates a new key with the admin scope (
admin:*). Name it something you’ll recognise, such as “Greenlight build token usage”, and copy it straight away: Cursor shows it once. A personal User API key won’t work. → Cursor’s API key docs - Store it in Greenlight. In the Build token usage card, next to Cursor sessions are not counted, choose Add, paste the key, and choose Save. Your install checks the key with Cursor before it saves it. If Cursor refuses the key, nothing is stored and the card says so.
- That’s it. The key is kept in your install’s secret store and is never shown again. To change it, choose Replace; to stop counting Cursor, choose Remove and confirm.
On a private install
Section titled “On a private install”If your install’s outbound traffic goes through your firewall, allow api.cursor.com. Your install needs it only for Cursor counts. Internal Health → Cluster health → Egress lists it with the other destinations Greenlight uses.
What builders need
Section titled “What builders need”- The current Greenlight plugin in their agent. It includes the hooks that report sessions.
- To be signed in to the Greenlight CLI (
greenlight login). The plugin sends with that sign-in. - To work inside the app’s folder, the one with
greenlight.yml. A session anywhere else isn’t counted. In Cursor, open the app’s folder itself: a window opened on a folder above it, such as the folder that holds all your projects, isn’t counted. - In Codex, to approve the plugin’s hook once under
/hooks.
Builders don’t need to do anything per session. → Build with your agent
Check that it’s working
Section titled “Check that it’s working”- Claude Code and Codex: a session’s tokens appear on Cost soon after the session ends.
- Cursor: counts appear within about an hour of the conversation, once your install next reads from Cursor. Cursor sometimes records usage late, so a conversation keeps being read for two days after it ends.
- The Build token usage card shows when Cursor usage was last read. If Cursor stops accepting the key (it was revoked in Cursor), the card says so and your install stops calling Cursor until you replace the key. If Cursor can’t be reached, the card says that too, and your install tries again the next hour.
What isn’t counted
Section titled “What isn’t counted”- Sessions before you turned the switch on, and sessions outside an app’s folder.
- Cursor cloud agents, which don’t run on a builder’s machine.
- Cursor usage under an email that doesn’t match the builder’s Greenlight email.
- A model Greenlight has no published price for: its tokens are kept and shown, but without a price.
- Cursor’s own billed amount. Cursor sessions are priced at the model vendor’s API prices, like every other session, so the figure is comparable across agents.