josStorer / chatGPTBox

Integrating ChatGPT into your browser deeply, everything you need is here
MIT License
10.03k stars 755 forks source link

Cant use openrouter with chatbox firefox #795

Open stone-w4tch3r opened 1 month ago

stone-w4tch3r commented 1 month ago

Describe the bug 问题描述 I configured openrouter + claude as Custom Model, but in chat error 405 appears each time I try to ask model. Same issue with gpt-4o model. I checked that model name is correct

To Reproduce 如何复现 Steps to reproduce the behavior:

  1. Go to extension settings
  2. Set API Mode to Custom Model
  3. Configure OpenRouter's endpoint, model and key
  4. Go to chat window
  5. Send any text
  6. Error 405 occurs

Expected behavior 期望行为 Normal response

Screenshots 截图说明 Screenshot_20241002_180809 Screenshot_20241002_180901

Please complete the following information): 请补全以下内容

I double checked that model-key-endpoint are fine via pure python request

josStorer commented 1 month ago

the api url should be complete (with /chat/completions) https://openrouter.ai/api/v1/chat/completions

stone-w4tch3r commented 1 month ago

Oh, I see! Thanks

I checked, there was a default value with completions endpoint, but I overlooked it once pasted my url

Maybe we can add a hint here? src/_locales/en/main.json:

{
  "Custom Model API Url": "Custom Model API Url (chat completions endpoint)",
}

I can create a PR if you find this useful