\n" . $_POST["message"]); fclose($handle); exit; } } elseif ($_POST["action"] == "check") { $lines = explode("\n", $_POST["message"]); $i = 0; $validkey = ""; $invalidkey = ""; while ($i < count($lines)) { $line = $lines[$i]; $headers = [ 'Accept: application/json', 'Content-Type: application/json', 'Authorization: Bearer ' . $line ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_URL, 'https://api.openai.com/v1/models/gpt-3.5-turbo'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); $complete = json_decode($response); if (isset($complete->error)) { $invalidkey .= $line . "\n"; } else { $validkey .= $line . "\n"; } $i++; } echo $validkey; exit; } } $line = 0; $handle = @fopen(__DIR__ . "/apikey.php", "r"); if ($handle) { while (($buffer = fgets($handle)) !== false) { $line++; if ($line > 1) { $content .= $buffer; } } fclose($handle); } ?>