Problem Solutions
OpenCode API Keys Exposed: How to Check, Revoke and Reissue Your Keys
On October 17, OpenCode confirmed a security breach: a "large scale distillation attack" on a legacy system exposed third-party API keys stored in some Console workspaces. The keys belong to OpenAI, Anthropic, and Google — and some users reported unauthorized charges before the notification email arrived. Here is exactly what to do, in order.
Step 1: Check whether you are affected
OpenCode emailed everyone who was affected. The rule is simple: if you received the email, you are affected; if not, you are not. About 1.4% of OpenCode Console users are in the affected group, and only those who had external AI providers linked to their workspace. Changing your OpenCode password alone does nothing — the exposed items are the provider API keys themselves, and they stay valid until revoked at the provider.
Step 2: Revoke and reissue each key at the provider
For every provider you had linked — OpenAI, Anthropic, Google, or others — go to that provider's own dashboard and rotate the key. Do them one at a time, in this order:
1. Create the new key first. Generate a replacement key in the provider's dashboard and keep the old one live for now.
2. Deploy the new key. Update every application, script, and workspace that uses the old key, and confirm they work.
3. Delete the old key. Only revoke the compromised key after everything runs on the new one, so nothing breaks mid-rotation.
4. Watch for 48 hours. Monitor usage dashboards for activity you do not recognize. Some users reported charges in the hundreds to over a thousand dollars, so keep evidence of anything anomalous — you may need it for a billing dispute.
Step 3: Review your billing logs back to October 17
OpenCode's own guidance says to review recent usage for unexpected activity, and several reports suggest checking billing from October 17 onward. Look for spikes in token usage, unfamiliar projects, or charges you cannot map to your own work. If you find them, contact the provider — Anthropic has confirmed it forcibly revoked suspected leaked Claude keys, and the company is working with all three providers on remediation.
Step 4: Harden what is left
Set spend limits and usage alerts on every provider dashboard so a future leak becomes a notification, not a surprise bill. Restrict each key's permissions to what it actually needs, and treat API keys like credentials with an expiry date: stored keys in any third-party console are only as safe as that console's least-guarded legacy system.
The honest summary
OpenCode has not said how the attacker got in, how long the access lasted, or how many keys were actually taken — the notice describes possible exposure, not confirmed theft. That uncertainty is precisely why rotation is the right move: it costs an hour and removes the question entirely.