PHP code example of zohaibtariq / count-gpt-token

1. Go to this page and download the library: Download zohaibtariq/count-gpt-token library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zohaibtariq / count-gpt-token example snippets


use CountGptToken;
CountGptToken::count_token('hello world'); // it can be your chatgpt2 or chatgpt3 prompt