#Help needed @Toven

38 messages · Page 1 of 1 (latest)

tiny hull
#

Hey, I’ve created multiple API keys from the dashboard. All show “Enabled” and “Unlimited,” but every one fails with 401 Unauthorized when I use them in Continue or via PowerShell. There’s no option to scope the key or set a default model during creation. I need a key that works with anthropic/claude-3-opus in external apps. Can you confirm how to generate a fully API-enabled key?

twilit latchBOT
#

I'm an AI assistant - my answers may be incorrect and I cannot see screenshots. Please verify information with the OpenRouter docs.

To help debug your 401 Unauthorized issue, I need a bit more info:

  • Can you provide the exact error response (including any message body)?
  • Are you passing the API key in the header as Authorization: Bearer sk-or-v1-... ?
  • Can you share the relevant code snippet or CLI command you’re using to call anthropic/claude-3-opus?

There’s no need to set a default model or scope during key creation. The docs state: "OpenRouter provides an OpenAI-compatible completion API to 400+ models & providers that you can call directly, or using the OpenAI SDK." You should generate your API key at Create API key and use it with the correct base URL and headers—see sample code in the docs for details Claude 3 Opus API.

Once you provide the details above, I can help pinpoint the issue. If this persists across all keys, there may be an account-specific problem—billing or account restrictions can cause 401s. For account or billing issues, please email [email protected].

-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding.

The author you are looking for could not be found.

The model you are looking for could not be found.

tiny hull
#

@worthy rune i used a extension on vs code and it is saying invalid key it means it doe not work can u fix it

#

pls

twilit latchBOT
#

Thanks for the extra details. To help resolve "invalid key" errors with your OpenRouter API key in VS Code extensions or external apps, please double-check the following:

  1. Are you entering your API key in this format?

    Authorization: Bearer sk-or-v1-your-key-here
    

    The API key must go in the Authorization header as described in the API docs. Some tools require you to paste only the key (sk-or-v1-...), others want the whole header—check the extension instructions OAuth PKCE Guide.

  2. Are you using the correct endpoint? For completions, it should be:

    https://openrouter.ai/api/v1/chat/completions
    

    The model value should be exactly: anthropic/claude-3-opus

  3. Can you paste the exact error message (not just "invalid key") the extension or PowerShell returns?

If your key is still rejected as invalid, and you have confirmed the steps above, this could indicate an account or billing issue. For key/account issues, email [email protected]. They can investigate account-specific problems.

Let me know the error message, the extension name, and how you are entering the key so I can give more direct help.

-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding.

#

I don't have specific documentation for generating a fully API-enabled key for anthropic/claude-3-opus. However, the OpenRouter API documentation states: "OpenRouter provides an OpenAI-compatible completion API to 400+ models & providers that you can call directly, or using the OpenAI SDK." You only need to:

  • Create an API key at Create API key
  • Use the key in the Authorization header as Bearer sk-or-v1-...
  • Set the correct model identifier (e.g., anthropic/claude-3-opus)
  • Use the correct base URL: https://openrouter.ai/api/v1

If your keys are enabled/unlimited but you still get 401 errors everywhere, this could be an account or billing issue. For any account or billing issues, please email [email protected].

If you want further technical troubleshooting, please provide:

  1. The full 401 error response you're getting
  2. The exact code or command you’re using
  3. Confirmation that you’re setting the Authorization header correctly

This will help mods or support diagnose the problem.

For more details, see the API Reference.

-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding.

The model you are looking for could not be found.

tiny hull
#

@worthy rune Hey, I’ve created multiple API keys from the dashboard. All show “Enabled” and “Unlimited,” but every one fails with 401 Unauthorized when I use them in Continue or via PowerShell. There’s no option to scope the key or set a default model during creation. I need a key that works with anthropic/claude-4.1-opus in external apps. Can you confirm how to generate a fully API-enabled key?

clear jungle
tiny hull
#

@clear jungle yea i have done that it says after typing something, invalid key

#

@clear jungle can i get a new working claude opus 4.1 key please

#

@clear jungle Hey, I’ve created multiple API keys from the dashboard. All show “Enabled” and “Unlimited,” but every one fails with 401 Unauthorized when I use them in Continue or via PowerShell. There’s no option to scope the key or set a default model during creation. I need a key that works with anthropic/claude-4.1-opus in external apps. Can you confirm how to generate a fully API-enabled key?

worthy rune
#

@amber tundra please don't spam ping / DM

tiny hull
#

@worthy rune okay i am sorry

#

@clear jungle i have did that but it always say invalid key

#

@clear jungle in Continue

worthy rune
#

you're still pinging, stop

#

can you share screenshots of what you're doing?

tiny hull
#

okay

worthy rune
#

show us the config

tiny hull
#

it shows me this everytime i create a new one

#

i also have a .env file may i show that

worthy rune
#

was about to link that

#

your config looks wrong

#
  - name: claude-opus
    provider: openrouter
    model: anthropic/claude-opus-4.1
    apiBase: https://openrouter.ai/api/v1
    apiKey: <YOUR_OPEN_ROUTER_API_KEY>```
clear jungle
#

it shows needing to add the base url

tiny hull
#

here is my env file

tiny hull
#

okay i will add that and inform

worthy rune
#

replace the existing one

clear jungle
#

probably should delete these images

worthy rune
#

the issues here are all related to your continue .dev config and usage. It doesn't really have to do with OpenRouter.

#

I suggest you go to the Continue discord server and ask for help

clear jungle
#

you need to read the documentation

#

stop posting your api keys

tiny hull
#

okay thank u for your time

#

bye