Skip to content

api key missing #51388

Closed as duplicate
Closed as duplicate

Description

@claudio9112

Description

Hello,

I have an active OpenCode Go subscription, but I cannot authenticate it successfully in the OpenCode CLI.

The CLI accepts the OpenCode Go login and reports “Connected to OpenCode Go”, but any actual request returns:

“Error: Invalid API key.”

I have completely removed all locally stored OpenCode Go and OpenCode Console credentials and started again from scratch.

The problem is that I cannot find any option in the OpenCode Console to generate or retrieve a new OpenCode Go API key. I only have some older API keys in my notes, and none of them works.

For example, testing:

opencode run -m opencode-go/qwen3.8-max "Respond simply: OK"

always returns:

Error: Invalid API key.

Could you please tell me exactly where I can retrieve or regenerate the API key associated with my OpenCode Go subscription?

I would prefer not to keep trying old credentials, since none of them works.

Thank you.

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. github-actions commented on Sep 25, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • #50885: Reports that an active OpenCode Go subscription has no visible API key or option to generate one, and asks how to obtain it.
    • #50900: Reports OpenCode Go requests failing with an authentication error after the Console/key migration.
    • #44326: Reports OpenCode Go models rejecting the API key with an invalid-key error.
  2. Voolan commented on Sep 27, 2026

    @Voolan

    @claudio9112

    Also, if you get an error when using Chinese AI models, go to Settings → Privacy in the same console (https://opencode.ai/console) and set the region to Global.

    I also recommend enabling “Allow paid endpoints that train on request data” if you plan to use models such as Muse Spark Contribution.

  3. Tarquinen commented on Oct 20, 2026

    @Tarquinen
    Member

    Thanks for the report! Closing as a duplicate of #50885, which has the answer: #50885 (comment)

    In short: in OpenCode 2.0, run /connect, choose opencode, and pick the workspace that has Go when signing in. Then select a model marked as Go. To use an API key instead, create one under a service account in the console and add it with /connect → opencode go.

    If this still fails on 2.0, please open a new issue with your version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions