OpenAI-API-dotnet icon indicating copy to clipboard operation
OpenAI-API-dotnet copied to clipboard

Can I set the base url to a different one rather than the one from openai

Open ericliu0408 opened this issue 2 years ago • 2 comments

Can I use this library to call api from a different url? This is because in some countries openai api can’t be accessed, some sort of wrapper api could be used instead, like this one : https://openai.api2d.net/

ericliu0408 avatar Apr 23 '23 04:04 ericliu0408

Could anybody please take a look at this issue? this function is critical to my project. many thanks!!! @OkGoDoIt @esp0 @dex3r @gotmike

ericliu0408 avatar May 01 '23 05:05 ericliu0408

This might work if the wrapper API follows similar endpoint names (eg. "chat/completions").

var api = new OpenAI_API.OpenAIAPI();
api.ApiUrlFormat = " https://openai.api2d.net/{0}/{1}";

the first arg in the URI format is the version and the second is the endpoint name.

nageshhebbarks avatar May 08 '23 17:05 nageshhebbarks