ztjhz / BetterChatGPT

An amazing UI for OpenAI's ChatGPT (Website + Windows + MacOS + Linux)
http://bettergpt.chat/
Creative Commons Zero v1.0 Universal
7.8k stars 2.63k forks source link

[SUGGESTION] Support OpenRouter Endpoints? #592

Open ibehnam opened 3 weeks ago

ibehnam commented 3 weeks ago

I love this project! The only suggestion I have is to support adding https://openrouter.ai/api/v1/chat/completions endpoint which lets us use almost every model out there. The models are prefixed like openai/gpt-4o, anthropicai/claude-opus, etc. It would be great to have this endpoint as well as OpenAI and Ollama.

I tried to do it myself but since TypeScript is not my main language, my version of the code would not work properly when selecting a non-OpenAI model (even though I was able to make the app use openrouter.ai endpoint).

I'd appreciate it if the maintainers could add this feature to the app and increase its usability! Thanks!

ghominejad commented 6 days ago

OpenRouter already supports the OpenAI standards. you only need to set https://openrouter.ai/api/v1/chat/completions and the token.

I have tested via http://bettergpt.chat and everything was fine but when I test with recent source from Github it has a formatting text issues and even with in-completed response.

I think the newly changes might cause this issue.

By the way for OpenAI models you don't have to set "openai/" as prefix but other companies same as Anthropic it's necessary.