GPT-4 Unlocker

Unlocks GPT-4 on ChatGPT.com

  1. // ==UserScript==
  2. // @name GPT-4 Unlocker
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Unlocks GPT-4 on ChatGPT.com
  6. // @author Rxzen-GPT
  7. // @match https://chatgpt.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. // Replace the ChatGPT API endpoint with the GPT-4 API endpoint
  13. const originalEndpoint = "https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key=";
  14. const newEndpoint = "https://generativelanguage.googleapis.com/v1beta2/models/text-bison-002:generateText?key=";
  15.  
  16. // Intercept and modify the API request
  17. const originalFetch = window.fetch;
  18. window.fetch = function(url, options) {
  19. if (url.startsWith(originalEndpoint)) {
  20. url = url.replace(originalEndpoint, newEndpoint);
  21. }
  22. return originalFetch(url, options);
  23. };
  24. })();