OpenCode Security Breach Exposes API Keys as Users Report Unauthorized AI Charges
OpenCode has confirmed a security breach that may have exposed third-party API keys stored in some user workspaces, prompting urgent warnings for affected developers to revoke and replace their credentials.
The open-source coding tool allows developers to connect external AI providers using their own API keys. These keys can grant applications access to services such as OpenAI, Anthropic, and Google models. If an API key falls into the wrong hands, attackers may be able to make requests through the linked account, potentially leaving the account owner responsible for the costs.
According to OpenCode, the incident involved unauthorized access to a legacy system that was already in the process of being retired. The company said API keys saved in user workspaces may have been exposed, including keys connected to major AI providers.
Reports from users suggest that some accounts were hit with unexpected usage charges before they received notice of the breach. One user claimed around $400 in unauthorized charges appeared on an Anthropic account, while another said Google-related usage fees had climbed to roughly €200 before the project was suspended for excessive abuse. Other users reported receiving unusual usage alerts from OpenAI and Anthropic ahead of OpenCode’s notification.
The breach has also caused access issues for some OpenCode users. Several people reported that their OpenCode service API keys had expired, while attempts to sign in through Google or GitHub returned an “Unable to start social login” error. Some users eventually managed to log in and generate new keys after repeated attempts, though others said replacement keys still failed to work properly.
OpenCode says the breach affected 1.4% of its Console users. The company stated that the impacted accounts were limited to a subset of users who had linked external AI providers. OpenCode has notified affected users by email and says users who did not receive a notification were not impacted.
The company has also connected the incident to a large-scale distillation attack. In this type of attack, large volumes of responses from an AI model may be collected and used to train or imitate another model. OpenCode says the incident is still ongoing and that it is working with Anthropic, OpenAI, and Google to address the situation.
Users who received a breach notification are being urged to take immediate action. OpenCode recommends revoking exposed provider API keys, generating new ones, updating any applications or services that rely on those keys, and reviewing recent account usage for suspicious or unexpected activity.
For developers using AI coding tools, the incident is a strong reminder of the importance of regularly rotating API keys, monitoring usage alerts, setting spending limits where possible, and avoiding long-term storage of sensitive credentials in connected workspaces. Even a single exposed API key can lead to rapid and costly abuse if attackers automate requests through a linked AI account.






