Back to Solutions

API Integration

Integrate quantum-native key generation into your applications with our RESTful API. Built for developers, designed for enterprise.

RESTful API for Quantum Key Generation

Our API provides programmatic access to Prime-Based QKD, NIST SP 800-22 validated keys, and comprehensive key management features.

RESTful Design

Standard HTTP methods and JSON responses. Works with any programming language or framework.

Secure Authentication

API key-based authentication with scoped permissions. OAuth2 support for enterprise deployments.

Real-time Analytics

Monitor usage, track key generation metrics, and access audit logs through dedicated endpoints.

Authentication

API Key Authentication

Include your API key in the request header:

curl -X POST https://api.qbitshield.com/api/qkd/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "security_level": 256,
    "keyType": "quantum"
  }'

Get Your API Key

Create and manage API keys from your dashboard. Each key can be scoped to specific permissions and environments (development, staging, production).

Go to API Keys Dashboard

Core Endpoints

Generate Quantum Key

Generate a quantum key with configurable security level and NIST SP 800-22 validation.

POST/api/qkd/generate

Request Body

{
  "projectId": "uuid",
  "apiKeyId": "uuid",
  "keyType": "quantum",
  "security_level": 256,
  "metadata": {
    "environment": "production"
  }
}

Response

{
  "success": true,
  "data": {
    "key_row": {
      "key_id": 123456,
      "key": "base64_encoded_key",
      "security_level": 256,
      "timestamp": "2025-01-24T...",
      "certification_status": "VALIDATED",
      "compliance_level": "NIST_SP_800_90B"
    },
    "metrics": {
      "latency_ms": 146.45,
      "entropy_bits": 256,
      "nist_status": "PASSED",
      "tests_passed": 15,
      "total_tests": 15
    },
    "mode": "simulated"
  }
}

API Key Management

Create, list, and manage API keys programmatically.

POST/api/api-keys/generate

Create a new API key with specified scopes and permissions.

DELETE/api/api-keys/[id]/revoke

Revoke an API key immediately.

Analytics & Monitoring

Access real-time metrics and usage statistics.

GET/api/analytics/usage

Retrieve usage statistics and key generation metrics.

GET/api/analytics/qkd

Get QKD-specific analytics and performance data.

GET/api/analytics/realtime

Access real-time system metrics and status.

Health & Status

Monitor API availability and system health.

GET/api/health

Basic health check endpoint.

GET/api/status

Comprehensive system status including quantum hardware connectivity.

GET/api/quantum-health

Check connectivity to IBM Quantum, IonQ, and other hardware backends.

Code Examples

JavaScript / TypeScript

async function generateQuantumKey() {
  const response = await fetch(
    'https://api.qbitshield.com/api/qkd/generate',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_API_KEY'
      },
      body: JSON.stringify({
        security_level: 256,
        keyType: 'quantum'
      })
    }
  );
  
  const data = await response.json();
  return data.data.key_row.key;
}

Python

import requests

def generate_quantum_key():
    response = requests.post(
        'https://api.qbitshield.com/api/qkd/generate',
        headers={
            'Content-Type': 'application/json',
            'Authorization': 'Bearer YOUR_API_KEY'
        },
        json={
            'security_level': 256,
            'keyType': 'quantum'
        }
    )
    return response.json()['data']['key_row']['key']

API Features

NIST SP 800-22 Validation

All generated keys pass 15/15 NIST statistical tests for randomness.

Low Latency

Median generation latency <0.6ms in internal tests.

Configurable Security Levels

Support for 128, 256, and custom security levels.

Audit Logging

Complete audit trail for compliance and security monitoring.

Rate Limiting

Configurable rate limits based on your subscription tier.

Webhook Support

Receive real-time notifications for key generation events.

Ready to Get Started?

Access the complete API documentation, SDK downloads, and integration guides.