Back to Documentation

API Reference

Complete endpoint documentation

Comprehensive reference for QBitShield's quantum-safe key generation API. All endpoints support JSON requests and return structured responses.

Authentication

All API requests require authentication via API key in the request header:

X-API-Key: your-api-key-here

Demo Keys

demo_key_for_testing
QSDemo

Rate Limits

Research: 1,000/month
Professional: 100,000/month
Enterprise: Unlimited
POST/api/v2/generate

Generate Quantum Key

Generate a quantum-safe cryptographic key using Prime Harmonic Modulation

Parameters

NameTypeRequiredDescription
security_levelintegerRequiredKey security level (128, 256, 384)
enable_nist_validationbooleanOptionalEnable NIST SP 800-22 validation
modulation_typestringOptionalModulation algorithm type

Example Request

curl -X POST "http://localhost:8000/api/v2/generate" \
  -H "X-API-Key: demo_key_for_testing" \
  -H "Content-Type: application/json" \
  -d '{
    "security_level": 256,
    "enable_nist_validation": true
  }'

Example Response

{
  "success": true,
  "key_id": "qbit_1755549791413078",
  "key": "694887d326681a6d1ba2d5b21e575787b8bea356065e0695c77641efba6b6341",
  "security_level": 256,
  "entropy_bits": 99.9,
  "latency_ms": 433.14,
  "nist_validation": {
    "certification_status": "PASS",
    "tests_passed": 15,
    "total_tests": 15,
    "compliance_level": "CERTIFICATION_READY"
  },
  "timestamp": "2025-08-18T20:37:33.254699+00:00"
}
POST/api/v2/validate

Validate Quantum Key

Validate the integrity and security of a quantum-generated key

Parameters

NameTypeRequiredDescription
keystringRequiredThe quantum key to validate
hash_proofstringOptionalHash proof for verification

Example Request

curl -X POST "http://localhost:8000/api/v2/validate" \
  -H "X-API-Key: demo_key_for_testing" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "694887d326681a6d1ba2d5b21e575787b8bea356065e0695c77641efba6b6341"
  }'

Example Response

{
  "success": true,
  "valid": true,
  "validation_details": {
    "key_format": "valid",
    "entropy_check": "passed",
    "proof_verification": "passed"
  },
  "timestamp": "2025-08-18T20:37:33.254699+00:00"
}
GET/api/v2/metrics

Get Analytics

Retrieve performance metrics and usage analytics

Parameters

NameTypeRequiredDescription
hoursintegerOptionalTime period in hours (default: 24)

Example Request

curl -X GET "http://localhost:8000/api/v2/metrics?hours=24" \
  -H "X-API-Key: demo_key_for_testing"

Example Response

{
  "success": true,
  "metrics": {
    "performance": {
      "total_keys_generated": 1247,
      "average_latency_ms": 0.6,
      "nist_compliance_rate": 1.0,
      "error_rate": 0.0
    },
    "usage": {
      "api_key_count": 4,
      "total_usage": 1247
    }
  },
  "timestamp": "2025-08-18T20:37:33.254699+00:00"
}

SDKs & Libraries

Official SDKs and community libraries for popular programming languages:

JavaScript/Node.js

npm install qbitshield

Coming Soon

Python

pip install qbitshield

Coming Soon

Go

go get github.com/qbitshield/go-sdk

Coming Soon