You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,13 @@
2
2
# ChatGPT-Java
3
3
A **Java** wrapper for the unofficial reverse-engineered [ChatGPT](https://chat.openai.com/) API.
4
4
5
+
## Important Update
6
+
OpenAI have recently implemented Cloudflare's Under Attack mode on ChatGPT, meaning you will need to supply a valid Cloudflare cookie and user agent to use the API.
7
+
8
+
This may be temporary, however we do not know at the moment.
9
+
10
+
Refer to the [Registering ChatGPT](https://github.com/AcaiSoftware/chatgpt-java#registering-chatgpt) section for more information on how to set these values.
11
+
5
12
## Add ChatGPT-Java to your own build
6
13
### Maven
7
14
```xml
@@ -13,7 +20,7 @@ A **Java** wrapper for the unofficial reverse-engineered [ChatGPT](https://chat.
13
20
<dependency>
14
21
<groupId>gg.acai</groupId>
15
22
<artifactId>chatgpt-java</artifactId>
16
-
<version>1.0</version>
23
+
<version>1.0.2</version>
17
24
</dependency>
18
25
```
19
26
@@ -22,7 +29,9 @@ A **Java** wrapper for the unofficial reverse-engineered [ChatGPT](https://chat.
22
29
All builder fields are optional except for ``sessionToken``.
23
30
```java
24
31
ChatGPT chatGpt =ChatGPT.newBuilder()
25
-
.sessionToken("token_here") // required field
32
+
.sessionToken("token_here") // required field: get from cookies
33
+
.cfClearance("cf_clearance_here") // required to bypass Cloudflare: get from cookies
34
+
.userAgent("user_agent_here") // required to bypass Cloudflare: google 'what is my user agent'
26
35
.addExceptionAttribute(newParsedExceptionEntry("exception keyword", Exception.class)) // optional: adds an exception attribute
0 commit comments