Skip to content

Latest commit

 

History

History
82 lines (64 loc) · 1.45 KB

File metadata and controls

82 lines (64 loc) · 1.45 KB

API Endpoints & curl Commands

Health Check

curl -s http://localhost:8000/health | jq

Generate Randomness (Async - Queued Job)

Request quantum random bits (queued job)

curl -s -X POST http://localhost:8000/generate \
  -H "Content-Type: application/json" \
  -d '{"n_bits": 64}' | jq

Request with simulator only (faster)

curl -s -X POST http://localhost:8000/generate \
  -H "Content-Type: application/json" \
  -d '{"n_bits": 1024, "force_simulator": true}' | jq

Response includes job_id - check status below

Get Job Status

curl -s http://localhost:8000/job/<job_id> | jq

Get Random Bits (Sync - Direct from Entropy Pool)

Get N bits directly from the entropy pool

curl -s "http://localhost:8000/random?n=64" | jq

Get hex representation

curl -s "http://localhost:8000/random?n=256" | jq

Check Entropy Pool Status

curl -s http://localhost:8000/entropy-pool | jq

CLI Usage

4-digit OTP

python qaas_cli.py otp -d 4

6-digit OTP (default)

python qaas_cli.py otp

Random number in range [min, max]

python qaas_cli.py range 1 100
python qaas_cli.py range 0 255

Random hex value

python qaas_cli.py hex
python qaas_cli.py hex -b 64

Custom API URL

python qaas_cli.py otp --api-url http://your-server:8000

Run directly

chmod +x qaas_cli.py && ./qaas_cli.py otp