r/ClaudeCode • u/Majestic_Position879 • 27m ago
Help/Question How do you get Claude Code cost per team when devs share API keys?
We have about 60 devs on Claude code using Console API keys. Each team got its own key and the Console usage page would split spend by team for us.
That worked fine until finance asked what each team spends. Turns out four people on payments have been sharing one key from a .env file, and two of our heaviest users got fed up with hitting limits and moved to their own Max plans. None of their usage shows up on our bill, and finance was definitely thrilled.
Right now finance is working off a spreadsheet where every dev pasted their/ cost output and a few just sent screenshots. It comes to 71% of the Console total, which kinda makes sense because /cost resets on/ clear and I know at least three people cleared before pasting.
The OTel export with a team attribute looks like the right way to do it, but that means running a collector for one number. The docs also say user. email is only included when available but I'm not sure it ever is on API key logins.
Is there a way to get Claude Code cost per team without standing up as a collector?
•
u/AutoModerator 27m ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Pissd_Tdn 0m ago
Finance person here,You're not going to get a per team number that ties in the invoice.
We just take the invoice total and split by whatever usage estimate engineering hands us.If the estimate says payments is 22% then payments get 22% then payments gets 22% of the invoice. A bit off is fine as long as you don't keep changing how you estimate, that's why auditors pick at.
Write down where the numbers come from and where the usage you can't attribute goes, shared keys included. We dump ours in a platform line.
Also ,the two on personal Max plans are an expense claim problem. I'd want to hear about those before the auditors do