Christopher-Hayes / vscode-chatgpt-reborn

Refactor, improve, and debug your code in VSCode with GPT-3 and GPT-4.
https://marketplace.visualstudio.com/items?itemName=chris-hayes.chatgpt-reborn
ISC License
207 stars 38 forks source link

OpenRouter API Support #66

Closed rambalachandran closed 1 month ago

rambalachandran commented 3 months ago

I love this extension and I have been using it heavily as part of vscode. However, im slowly starting to see custom tuned models outperforming GPT in many coding aspects.

While its hard to integrate and cater to many models, there are tools like OpenRouter ( https://openrouter.ai/) that provide a unified API gateway to many such models including GPT.

While it might be a big effort, i think supporting open router can significantly help a lot of developers like me.

Happy to provide any testing or documentation support for this effort

Christopher-Hayes commented 3 months ago

Glad to hear it Ram! Apologies if this extension is starting to feel neglected, I haven't gotten much time of late to work on it.

OpenRouter looks nice, from the docs you actually may be able to use OpenRouter with this extension right now because it says it's compatible with the OpenAI API. If you change the baseURL in the extension to https://openrouter.ai/api/v1 (and use your OpenRouter api key) you may be able to use it already. But, I definitely support and any open-standards initiatives.

So, making it more clear in the extension what services are compatible and making it easier to set that up is something I can work on adding.

rambalachandran commented 1 month ago

@Christopher-Hayes I changed the baseURL and set the corresponding API keys I got the following error

401 Unauthorized

Make sure your API key is correct, you can reset it by going to "More Actions" > "Reset API Key". Potential reasons:

- 1. Incorrect API key provided.

- 2. Incorrect Organization provided.

See https://platform.openai.com/docs/guides/error-codes for more details.

Also when I change the baseURL to https://openrouter.ai/api/v1, I'm unable to reset the API Keys

rambalachandran commented 1 month ago

@Christopher-Hayes please let me know if you need me to any additional test. Supporting open router can help to use a wide range of models beyond OpenAI.

Christopher-Hayes commented 1 month ago

Added in v3.23.0. Open Router is very nice.