This project is the Java version(Only Auth model) of revChatGPT.
Import library
- Maven
<dependency>
<groupId>com.obiscr</groupId>
<artifactId>openai-auth</artifactId>
<version>1.0.0</version>
</dependency>
Create an auth object:
OpenAIAuth openAIAuth = new OpenAIAuth("<your email>","<your password>");
OpenAISession auth = openAIAuth.auth();
System.out.println(JSON.toJSONString(auth));
Create an auth object with proxy:
// Create proxy if needed
Proxy proxy = new OpenAIProxy("127.0.0.1",
11111, Proxy.Type.HTTP).build();
OpenAIAuth openAIAuth = new OpenAIAuth("<your email>","<your password>",proxy);
OpenAISession auth = openAIAuth.auth();
System.out.println(JSON.toJSONString(auth));