准备
检查 rust 版本,要求 ≥ 1.82
rustc --version
如果版本落后
rustup update stable
如果还没有安装
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
安装
git clone https://github.com/Yoo1tic/Gemini-Keychecker.git --depth=1 checker && cd $_
编译
cargo build --release
软链
ln -sf target/release/gemini-keychecker gemini-keychecker
运行
创建 keys-gemini-all.txt 格式如下
AIzaSyxxxxxxxxxxxxxxefghij
AIzaSyxxxxxxxxxxxxxxefghij
AIzaSyxxxxxxxxxxxxxxefghij
执行命令
./gemini-keychecker -c 100 -t 10 -i keys-gemini-all.txt
支持的命令行参数
Options:
-i, --input-path <INPUT_PATH> Input file containing API keys [default: keys.txt]
-b, --backup-path <BACKUP_PATH> Backup file for all processed keys [default: backup_keys.txt]
-u, --api-host <API_HOST> API host URL [default: https://generativelanguage.googleapis.com/]
-t, --timeout-sec <TIMEOUT_SEC> Request timeout in seconds [default: 15]
-c, --concurrency <CONCURRENCY> Max concurrent requests [default: 50]
-r, --max-retries <MAX_RETRIES> Max retry attempts for failed requests [default: 2]
-x, --proxy <PROXY> Proxy URL (http://user:pass@host:port)
-h, --help Print help
完成后会在目录生成
backup.txtpaidkey.txtfreekey.txtinvalidkey.txt
参考链接
- https://github.com/Yoo1tic/Gemini-Keychecker