|
| 1 | +> [!WARNING] |
| 2 | +> FreeGPT.js/this project is not affiliated with ChatGPT in any kind. I'm not responsible for anything and this project is just for educational purposes. |
| 3 | +
|
| 4 | + <h1>FreeGPT.js</h1> |
| 5 | + |
| 6 | + **🤖 A great, stable but free ChatGPT library with no authentication at all!** |
| 7 | + |
| 8 | +> [!TIP] |
| 9 | +> If you are looking for a template or example, go ahead and look the branch **react**. It uses Next.js with FreeGPT.js to make a simple, but working, great and free unlimited chat application. |
| 10 | +> Or you can checkout my ChatGPT UI Clone + Implementation: [ChatGPT Clone with Next.js and FreeGPT.js][https://ashishagarwal.is-a.dev/chatgpt-clone/] |
| 11 | +
|
| 12 | +> Give it a try! Go [here](https://ashishagarwal.is-a.dev/chatgpt-clone) to test the FreeGPT.js out! It's free! |
| 13 | +
|
| 14 | +[](https://github.com/ashishagarwal2023/freegptjs/stargazers) [](https://github.com/ashishagarwal2023/freegptjs/blob/main/LICENSE.md) [](https://github.com/ashishagarwal2023/freegptjs/commits/main) |
| 15 | + |
| 16 | +<div id="intro"> |
| 17 | + |
| 18 | +## 💡 About |
| 19 | + |
| 20 | +</div> |
| 21 | + |
| 22 | +freegpt is a powerful javascript library you can use to get ChatGPT on your website, and its free! |
| 23 | + |
| 24 | +- Simple, just one function |
| 25 | +- Open-source, free |
| 26 | +- Easy-to-use |
| 27 | +- Lightweight (yet optimally performant) |
| 28 | +- No authentication, free for all |
| 29 | +- Unlimited GPT 3.5 Model |
| 30 | + |
| 31 | +<div id="importing"> |
| 32 | + |
| 33 | +## Examples |
| 34 | +Just one yet, but this list can be filled. |
| 35 | + |
| 36 | +[ChatGPT Clone with Next.js and FreeGPT.js](https://ashishagarwal.is-a.dev/chatgpt-clone/) |
| 37 | + |
| 38 | + |
| 39 | +You built something **cool**? Make a issue or PR! |
| 40 | + |
| 41 | +## ⚡ Adding the library |
| 42 | + |
| 43 | +</div> |
| 44 | + |
| 45 | +Load `https://cdn.jsdelivr.net/gh/ashishagarwal2023/freegpt.js.org@master/src/freegpt.js` as a script in your `<head>` and call it after its loaded. |
| 46 | + |
| 47 | +```html |
| 48 | +<script src="https://cdn.jsdelivr.net/gh/ashishagarwal2023/freegpt.js.org@master/src/freegpt.js"></script> |
| 49 | +``` |
| 50 | + |
| 51 | +> Load the freegpt lib the same way in your <head> in your layout of Next/React project, then use `await gpt.ask` to see if it works. If `gpt.ask` is not defined (probably when using with Nodejs), try `window.gpt.ask`. The library will only work on client-side. |
| 52 | +
|
| 53 | +## 💻 Usage |
| 54 | + |
| 55 | +```js |
| 56 | +(async () => { |
| 57 | + let response = await gpt.ask("Explain variables in javascript"); |
| 58 | + console.log(response); // you got it! |
| 59 | +})(); |
| 60 | +``` |
| 61 | + |
| 62 | +And that is all. |
| 63 | + |
| 64 | +> [!IMPORTANT] |
| 65 | +> If you are receiving error even when library is loaded (probably with React, and might also with Vue, Angular, etc), then use `window.gpt.ask` instead of `gpt.ask`. |
| 66 | +> And next thing, the `window.gpt.ask` is only available on client-side components, as you may know. |
| 67 | +
|
| 68 | +## 🤖 Why client-side? |
| 69 | + |
| 70 | +This is a reverse-engineer of a ChatGPT AI service, [You.com](https://you.com). |
| 71 | + |
| 72 | +They, for their own security, added Cloudflare Protection to the API. This can only be bypassed on JavaScript client-side. |
| 73 | + |
| 74 | +> Please do not make issues regarding not working with Nodejs like #1 |
| 75 | +
|
| 76 | +### Why I just made it? |
| 77 | + |
| 78 | +Building AI applications isn't free, but I wanted to do it. This does not cost me a penny, feel free to use! |
| 79 | + |
| 80 | +Give it a star if you want to help me keep it active. |
| 81 | + |
| 82 | +It depends on **You.com**'s API, however its reverse engineered. Please note that I'm not responsible for anything and this is just for educational purpose.s |
| 83 | + |
| 84 | +## 🤝Contributing |
| 85 | + |
| 86 | +You are welcome! I'm looking for some cool peoples to help me push this project further! |
| 87 | + |
| 88 | +> I'm currently in-active on this project but you could, if you wish, try to implement conversations! :D |
| 89 | +
|
| 90 | +PRs are welcome, good issues too! |
0 commit comments