ChatGPT API used with Java & Spring

How to get it running

Setup proxy

If you need a proxy to communicate with Internet (ChatGPT API is in Internet), adapt ChatGptController.java like this:

  • Replace: private HttpClient client = HttpClient.newHttpClient();
  • with: private HttpClient client = HttpClient.newBuilder().proxy(ProxySelector.of(InetSocketAddress.createUnresolved("proxy.host.com", 8080))).build();

More information