Skip to content

Use PandoraNext to Getn and Refresh ChatGPT Web Access Token

License

Notifications You must be signed in to change notification settings

leokwsw/OpenAI-RefreshToken

Repository files navigation

Use PandoraNext looping to get ChatGPT AccessToken

  • Welcome to Create PR to fix bugs and Create issues to tell me more about anythings
  • The License is MIT

Version

20240119 - first version, loop account item call PandoraNext to get access token

Setup Step

  1. clone project

    git clone https://github.com/leokwsw/PandoraNext-RefreshToken
    cd PandoraNext-RefreshToken
  2. get PandoraNext License Link

  3. copy PandoraNext config and token file, and follow config.json and tokens.json to set up PandoraNext

    cd pandoranext/data
    cp example.config.json config.json
    # edit config.json
    cp example.tokens.json tokens.json
    # edit tokens.json
    cd ../
    docker-compose up -d
  4. copy and edit config file

    cd ../
    cp config_template.yaml config.yaml 
    # edit config file
  5. copy and edit account.json

    cp example.account.json account.json 
    # edit account file

    Please follow the json format below

    [
      {
        "email": "openai1@example.com",
        "password": "password"
      },
      {
        "email": "openai2@example.com",
        "password": "password"
      },
      ...
    ]
  6. install dependency

    pip install -r requirements.txt
  7. run it

    python main.py
  8. after the python finish to run, the json file named account.json will be look like this

    [
      {
        "email": "openai1@example.com",
        "password": "password",
        "access_token": "{{JWT Token}}",
        "access_token_expire_at": "2024-01-29 10:14:19.929272"
      },
      {
        "email": "openai2@example.com",
        "password": "password",
        "access_token": "{{JWT Token}}",
        "access_token_expire_at": "2024-01-29 10:15:00.479372"
      },
      ...
    ]
  9. you can use the access_token to call ChatGPT API.

About

Use PandoraNext to Getn and Refresh ChatGPT Web Access Token

Topics

Resources

License

Stars

Watchers

Forks

Languages