Home / News EN / OpenCode: Distillation attack steals OpenAI and Anthropic API keys

OpenCode: Distillation attack steals OpenAI and Anthropic API keys

OpenCode has confirmed it suffered an attack linked to an artificial intelligence model distillation system, resulting in the theft of API keys associated with OpenAI, Anthropic, and Google. The incident affected 1.4% of Console platform users, who were notified via email while investigations are still ongoing.

OpenCode distillation attack

The company, which operates an AI-based agentic coding platform, disclosed the incident on the morning of October 17 through a public statement, describing the attack as “large-scale distillation.” It involved a specific subset of users who had connected external AI providers such as OpenAI, Anthropic, and Google to their OpenCode accounts. Unaffected users did not receive any communication.

OpenCode distillation attack: why it matters

According to the statement, the intrusion occurred through unauthorized access to a legacy system that OpenCode was decommissioning. API keys stored in user workspaces were recovered from this system; these credentials are normally used to route requests to third-party provider models without having to re-enter access tokens each time.

A distillation attack exploits another party’s access to a large AI model to mass-collect its responses, often with the goal of training a competing model at almost no cost. The victim inadvertently finances the training of a rival system, as every query generated with a stolen key is billed to the legitimate credential holder.

Several OpenCode users reported anomalous spending alerts and unexpected charges on keys used exclusively within the platform in the hours following the incident disclosure. In some cases, these costs escalated to hundreds of dollars due to repeated queries against high-end models.

OpenCode stated it is collaborating with Anthropic, OpenAI, and Google to manage the situation but has not yet clarified how charges generated by the fraudulent use of keys will be handled. The company also specified that it cannot provide further technical details while the investigation remains ongoing, a choice understandable from an investigative standpoint.

What changes and what are the effects

Affected users are asked to revoke and replace their API keys with each provider, check consumption records starting from October 16, and, where possible, set spending caps and automatic alerts to prevent further financial damage. This procedure falls entirely on the users’ shoulders, while it remains to be seen how well OpenCode’s infrastructure was actually prepared to contain such a scenario.

The company specified that users not involved in the incident did not receive communications and that the investigation is still open. OpenCode is working with AI providers to manage the situation, but no details have been provided yet on how expenses arising from the fraudulent use of API keys will be handled.

Source and further reading on OpenCode distillation attack: original article.

* Content created with the assistance of artificial intelligence systems.