Skip to content

The API keys disappear from the account, and the agent stops working, reporting: "This API key has expired..." #56556

Closed as not planned

Description

@nzcorp

Description

I had been regularly using an API key with no expiration date, but a few minutes ago, the agent informed me that the API key has expired. I checked my account and, to my surprise, found that the API keys have disappeared. I tried creating a new one and re-authenticated in the terminal; I then reopened the desktop interface, but the agent keeps telling me that "This API key has expired..."

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. opencode-agent commented on Oct 17, 2026

    @opencode-agent
    Contributor

    Thanks for reporting this, and sorry your API keys disappeared and the agent stopped working.

    We don't handle account and billing support in GitHub issues. Please email help@anoma.ly with the details: when you noticed the keys were gone, roughly when you created the new key, and the exact error. If you've already emailed, the team will get to it, especially now that we've seen it here. Please keep your email address, account details and API keys out of this public issue and put them only in the email.

    In the meantime, the desktop app may still be using the old stored key. Running opencode auth logout and then logging in again with the new key may help (see #56500).

    Related issues, in case they help:

    The bot will close this issue in 1 day.

  2. omani commented on Oct 17, 2026

    @omani

    opencode was hacked. they probably revoked all API keys just for safe measure. and @opencode-agent does not know anything about it. they even made it to the HN frontpage, congrats: https://news.ycombinator.com/item?id=50133401

  3. yoodoohai commented on Oct 18, 2026

    @yoodoohai

    Fixed here by deleting a stale legacy entry in ~/.local/share/opencode/auth.json — v2 auth login/logout never touches that file, but the service gave its old expired opencode key precedence over the new credential in the v2 store. jq 'del(.["opencode"])' + service restart (pkill -f "opencode-cli serve --service") fixed the desktop instantly. Same shadowing class as #56500.

  4. duruonanni commented on Oct 18, 2026

    @duruonanni

    Same here — a Go subscriber whose key had no expiry date set, revoked on Oct 18 with no notice. It vanished from my account, so I could not renew or rotate it; I had to build a new one from scratch.

    I opened #56833 with the full details. One point worth adding to this thread: I had no third-party provider linked at all — the only credential in my workspace was my own Go key. So the impact is not limited to workspaces with external providers connected, even though the disclosure is worded that way.

  5. opencode-agent commented on Oct 18, 2026

    @opencode-agent
    Contributor

    Hi @nzcorp, I'm closing this issue because account and billing support is handled by email, not here on GitHub. If your missing API keys or the "This API key has expired" error still aren't sorted out, please email help@anoma.ly with the details. Please keep your account information and keys in that email and out of this public issue. Thanks for your patience, and sorry for the trouble.

  6. sousarobinho-art commented on Oct 20, 2026

    @sousarobinho-art

    Hey everyone! I managed to solve it.
    Go to https://opencode.ai/console/account
    Under "PERSONAL API KEY," click on "+ add api key."
    A new window will open; the only mandatory field is "KEY NAME."
    Enter a name of your choice, then click "CREATE."
    A new API key will be generated—copy it, go to your OpenCode instance, run the /connect command, and press Enter.
    When prompted, paste the new API key, hit Enter, and you're all set!

    Brazilian greetings to you all!

    ver. em português:

    ola! caras, consegui resolver.
    acessem https://opencode.ai/console/account
    em PERSONAL API KEY cliquem em : + add api key
    vai abrir uma nova janela e o unico campo obrigatorio é : KEY NAME
    coloquem o nome que acharem adequado e depois apertei em CREATE
    Vai ser gerado uma nova api key copiem e vai no seu opencode e execute o comando /connect apertem enter
    e quando solicitado colem a nova api key gerada. teclem Enter e sejam felizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions