Open xcyk1226 opened 8 months ago
just change the base URL in file- OpenAiService.java
it mentions - private static final String BASE_URL = "https://api.openai.com/";
Rewrite an OpenAiService class in your own project, and after modifying the BASE-URL, you also need to modify the baseUrl in the defaultRetrofit method
ObjectMapper mapper = defaultObjectMapper();
OkHttpClient client = defaultClient(apiKey, Duration.of(timeout, ChronoUnit.SECONDS))
.newBuilder()
.build();
Retrofit retrofit = OpenAiService.defaultRetrofit(client, mapper)
.newBuilder()
.baseUrl(baseUrl)
.build();
OpenAiApi api = retrofit.create(OpenAiApi.class);
OpenAiService service = new OpenAiService(api);
How to modify OpenAI base url ?