Skip to content

Incorrect API key provided: sk #51419

Description

@scrapelabs

OpenCode returns an OpenAI 401 when sending a prompt. The error is:

`Incorrect API key provided: sk-svcac****************************************************************

OpenCode’s bot is asking you to edit the issue body (not just comment). The numbered fields were left as No response. You have about two hours.

I do not have the issue URL, so I cannot push the edit for you. On GitHub: Edit the issue, then replace No response under these headings.

Run this first and paste the exact output into OpenCode version:

opencode --version
Use this under the matching headings (API key already redacted):

Steps to reproduce
Install OpenCode and start the TUI (opencode) in PowerShell.
Authenticate with /connect (or opencode auth login) using the OpenAI provider and paste an API key. Do not include the real key in the issue.
Select an OpenAI chat model (note the exact provider/model id in this field).
Send any prompt, e.g. hello.
Observe the provider error (redacted):
Incorrect API key provided: sk-svcac***fvMA. You can find your API key at https://platform.openai.com/account/api-keys.

Provider / config (no secrets):

Provider: OpenAI
Model: <fill in, e.g. openai/astra>
Auth method: OAuth

Activity

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