OpenCode API key leak: OpenAI, Anthropic and Google keys exposed
The OpenCode API key leak hit 1.4% of Console users and their OpenAI, Anthropic and Google keys. What we know about the attack and what to do with your keys now.
This article in other languages:العربيةDeutschEspañolFrançaisItaliano日本語Polski简体中文
In this article
On October 17, the OpenCode team posted on X that a breach linked to a “large scale distillation attack” had happened the night before, affecting 1.4% of OpenCode Console users. The OpenCode API key leak involves keys for third-party providers that users had connected in their workspaces.
What do we know about the OpenCode API key leak?
OpenCode is an open-source agent harness that runs in the terminal, and Console is its hosted dashboard where you can store keys for other companies’ models. According to the team’s post:
- Those affected are a subset of users who had external providers connected.
- All of them got an email on the morning of October 17. According to OpenCode, if you didn’t get the email, you’re not part of the incident.
- The incident is still ongoing, so there aren’t many details yet, and the team is working with Anthropic, OpenAI and Google.
The email to users, as described by Notebookcheck, says someone gained unauthorized access to a legacy system that was in the process of being shut down. The keys that may have leaked include OpenAI and Anthropic keys, and OfficeChai adds Google to the list.
Why is everyone talking about it?
Because this isn’t just a theoretical risk. The thread “OpenCode Hacked: User credentials leaked” has over 500 points on Hacker News, and users are posting real bills. According to Notebookcheck, one person reported $400 of unauthorized usage on their Anthropic account, another about €200 in Google charges, and someone else had a Google project suspended for “excessive abuse”. Some people got usage alerts from OpenAI and Anthropic before the OpenCode email even arrived.
On top of that, OpenCode co-creator Dax Raad wrote that his personal accounts are now being targeted too, adding that it’s a “whole new world with ai powered hacking”.
What “distillation attack” means in this particular case isn’t known. The term usually refers to querying a model at scale to collect its outputs and train your own model on them. Stolen keys would provide free access for that on someone else’s bill, but that’s only an interpretation the OpenCode team hasn’t confirmed.
What to do after the OpenCode leak?
If we got an email from OpenCode (or we’re not sure it didn’t land in spam), the advice from the notice is simple:
- Let’s revoke our keys for OpenAI, Anthropic and Google in those providers’ dashboards and generate new ones.
- Let’s swap the keys in every app and script that used the old ones.
- Let’s review recent usage on our provider accounts and look for anything we didn’t do.
It’s also worth setting spending limits and alerts with every provider, if we don’t have them yet. That won’t stop a leak, but it will cap the bill if a key ends up in the wrong hands. The CyberSec Guru also advises not to put new keys back into Console until things are cleared up.
Interestingly, not everything on OpenCode’s side is running smoothly. According to Notebookcheck, some users found their OpenCode keys had expired, social login returned an “Unable to start social login” error, and some couldn’t generate working new keys.
A few days ago I wrote about free DeepSeek in OpenCode. If you set it up back then through Console with providers connected, now is a good time to check your inbox.
FAQ
Did my key leak if I didn’t get an email from OpenCode?
According to the OpenCode team, everyone affected by the incident got an email, and those who didn’t weren’t affected. The incident is still ongoing, so reviewing usage on your provider accounts won’t hurt anyway.
How many users did the OpenCode leak affect?
1.4% of OpenCode Console users, and only those who had external providers connected. No absolute number was given.
Does the leak also affect Anthropic, OpenAI and Google?
What leaked were API keys for those companies stored in OpenCode, not their systems. The OpenCode team is working with them to deal with the fallout.