TrueEntropy offers three distinct entropy modes to balance security, performance, and cost. Choose the right mode for your application's needs.
All TrueEntropy API endpoints support the entropy_mode parameter, which controls the source of randomness for your request. The available modes are:
Every random number starts with genuine quantum entropy, cryptographically expanded using ChaCha20 for unlimited scale. Perfect for most applications.
Direct from IBM Quantum hardware with no expansion or mixing. For cryptographic keys and regulatory compliance. Uses monthly credits.
Cryptographically secure pseudo-random numbers using system entropy. Available to all tiers, including free users.
| Feature | Quantum-Seeded | Pure Quantum | CSPRNG |
|---|---|---|---|
| Quantum Origin | Yes (seed) | Yes (100%) | No |
| Scalability | Unlimited | Limited by credits | Unlimited |
| Speed | ~1μs/number | ~10μs/number | ~1μs/number |
| Cost | Included | Uses credits | Free |
| Available Tiers | Developer+ | Pro+ | All |
| Best For | Gaming, simulations | Crypto keys, compliance | Development, testing |
Add the entropy_mode parameter to any endpoint:
# Default (auto mode - selects based on your tier)
GET /api/v1/integers/?count=10&min=1&max=100
# Explicitly request quantum-seeded
GET /api/v1/integers/?count=10&min=1&max=100&entropy_mode=hybrid
# Request pure quantum (Pro+ tiers only)
GET /api/v1/integers/?count=10&min=1&max=100&entropy_mode=pure
The API returns the entropy mode used in response headers:
X-Entropy-Mode: quantum-seeded
X-Quantum-Credits-Remaining: 8453
X-Request-ID: 550e8400-e29b-41d4-a716-446655440000
The response includes entropy mode information:
{
"data": {
"values": [42, 17, 89, 3, 61],
"count": 5,
"min": 1,
"max": 100,
"metadata": {
"entropy_mode": "quantum-seeded",
"quantum_source": "ibm_fez"
}
},
"quantum_credits": {
"remaining": 9216,
"used": 0,
"total": 10240
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"duration_ms": 12
}
}
| Tier | Monthly Credits | Equivalent Usage |
|---|---|---|
| Free | 0 | No pure quantum access |
| Developer | 0 | Quantum-seeded only |
| Pro | 10,240 bytes (10KB) | ~640 AES-256 keys |
| Business | 102,400 bytes (100KB) | ~6,400 AES-256 keys |
| Enterprise | Custom | Negotiated |
Pure quantum mode consumes credits based on the entropy required:
Use the default quantum-seeded mode. It provides quantum-origin randomness with unlimited scalability at no additional cost.
Use pure quantum mode when generating cryptographic keys, initialization vectors, or when regulatory compliance requires true randomness.
from trueentropy import Client
client = Client(api_key="YOUR_API_KEY")
# Default quantum-seeded mode
numbers = client.integers(count=10, min=1, max=100)
# Explicitly request pure quantum
key_bytes = client.bytes(
count=32,
format="hex",
entropy_mode="pure" # Uses credits
)
# Check remaining credits
print(f"Credits remaining: {key_bytes.quantum_credits.remaining}")
import { TrueEntropy } from 'trueentropy';
const client = new TrueEntropy('YOUR_API_KEY');
// Default quantum-seeded mode
const numbers = await client.integers({
count: 10,
min: 1,
max: 100
});
// Request pure quantum for cryptographic key
const keyBytes = await client.bytes({
count: 32,
format: 'hex',
entropyMode: 'pure' // Uses credits
});
console.log(`Credits remaining: ${keyBytes.quantumCredits.remaining}`);
# Quantum-seeded (default)
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.trueentropy.net/v1/integers/?count=10&min=1&max=100"
# Pure quantum
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.trueentropy.net/v1/bytes/?count=32&format=hex&entropy_mode=pure"