Generates cryptographically secure random tokens for API keys, session IDs, or secrets. Access via MCP in Cursor/Windsurf or GET /v1/generate/token. Returns base64-encoded tokens with customizable length. Uses secure randomness sources, making it perfect for authentication systems where Claude or other AI agents need to create proper tokens instead of guessing formats.
curl "https://tinyfn.io/v1/generate/token" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/generate/token', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/generate/token',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's generator tools:
{
"mcpServers": {
"tinyfn-generator": {
"url": "https://tinyfn.io/mcp/generator",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Call GET /v1/generate/token with optional length parameter. Returns cryptographically secure base64-encoded token suitable for API authentication.
This uses cryptographically secure randomness while Math.random() is predictable. Always use secure generators for authentication tokens, passwords, or secrets.
Yes, specify byte length via parameters. Output is base64-encoded by default, providing URL-safe characters suitable for most authentication systems.
AI agents in Cursor or Claude Code can generate proper tokens for API integrations, avoiding hardcoded or weak credentials in generated code.
Yes, the cryptographic security meets production standards. Ensure appropriate token expiration and single-use policies in your application logic.
Get your free API key and start using Generate Token in seconds.
Get Free API Key