Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openrouter {'message': 'Missing Authentication header or invalid API key', 'code': 401}} #357

Closed
HuggingTech opened this issue May 28, 2024 · 7 comments

Comments

@HuggingTech
Copy link

"I'm using openrouter to access gpt-4, configuring the taskweaver_config.json file with the settings as shown in the figure, but I keep getting this error message every time I ask a question."

{
"llm.api_base": "https://openrouter.ai/api/v1",
"llm.api_key": "sk-0r-v1-3760747aa4803dfla7b0f3da07e104210d1c.......................................",
"llm.model": "openai/gpt-4o"
}

image
@liqul
Copy link
Contributor

liqul commented May 28, 2024

Haven't tested this endpoint before. Could you firstly try if you can access the endpoint using a simple script with the openai module? then, we can rule out the possibilities of any configuration errors.

@HuggingTech
Copy link
Author

Haven't tested this endpoint before. Could you firstly try if you can access the endpoint using a simple script with the openai module? then, we can rule out the possibilities of any configuration errors.

"We use Docker images and pass OpenRouter parameters through environment variables, which works fine. Currently, we are running the code from the main branch, and the same parameters are causing the above error."

@HuggingTech
Copy link
Author

"I also encounter the same error when running the LLM_API_test unit test."

@HuggingTech
Copy link
Author

"I rewrote an independent test and connected to OpenRouter, which was successful. However, I could not connect using TaskWeaver, possibly due to a defect in the TaskWeaver code, and the reason has not yet been identified."

image

@liqul
Copy link
Contributor

liqul commented May 28, 2024

I just registered and try a random query with the following configurations:

  "llm.api_base": "https://openrouter.ai/api/v1",
  "llm.api_key": "sk-or-v1-2bb53d5f2774e4e4a6d....",
  "llm.model": "openchat/openchat-7b",

Everything went well. I got the following output:

 TaskWeaver ▶  I am TaskWeaver, an AI assistant. To get started, could you please enter your request?
    Human   ▶  Hi
 ╭───< Planner >askWeaver] preparing          <=�=>
 ├─► [init_plan] 1. Respond to the user's greeting    <=�=>      
 ├─► [plan] 1. Respond to the user's greeting      <=�=>     
 ├─► [current_plan_step] 1. Respond to the user's greetinghe u         <=�=> 
 ├──● Hello, what can I help you?o, what can    <=�=>        
 ├─► [board]
 │   I have drawn up a plan: 
 │   1. Respond to the user's greeting
 │   
 │   Please proceed with this step of this plan: Hello, what can I help you?
 ╰──● sending message to User
 TaskWeaver ▶  Hello, what can I help you?

So, I'm not sure what is the problem in your case.

@HuggingTech
Copy link
Author

3q

@Boburshoh-oss
Copy link

Haven't tested this endpoint before. Could you firstly try if you can access the endpoint using a simple script with the openai module? then, we can rule out the possibilities of any configuration errors.

"We use Docker images and pass OpenRouter parameters through environment variables, which works fine. Currently, we are running the code from the main branch, and the same parameters are causing the above error."

I had same problem with openrouter key, befor running well and then reached error as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants