Generate cryptographically secure API keys for OpenAI, Google Gemini, Anthropic Claude, and any AI service. Fully customizable & client-side only — no keys are ever transmitted.
.env file or environment variables: API_KEY=your_generated_keyAuthorization: Bearer YOUR_API_KEY Example (Node.js): const apiKey = process.env.API_KEY;
window.crypto.getRandomValues() API, which is a cryptographically secure pseudorandom number generator (CSPRNG) built into all modern browsers. The entire process happens entirely on your device — no keys are ever sent to any server, logged, or stored remotely. You can verify this by disconnecting from the internet; the generator still works perfectly. This makes it safer than many online key generators that might transmit data over networks.
.env files (add .env to .gitignore)direnv or platform-specific secure storesfunction generateAPIKey(length = 48, charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {
const randomValues = new Uint8Array(length);
window.crypto.getRandomValues(randomValues);
let result = '';
for(let i = 0; i < length; i++) {
result += charset[randomValues[i] % charset.length];
}
return result;
}
This uses the same CSPRNG for maximum security.
getRandomValues() which sources entropy from the operating system's random number generator (e.g., /dev/urandom on Unix, CryptGenRandom on Windows). This provides true cryptographic randomness, not the pseudo-random Math.random() which is unsuitable for security. Each generated key is statistically independent and unpredictable, even if an attacker knows previous keys.