QuantumLockβ’ API Reference
Complete REST API Documentationβ
Base URL: https://api.quantumlock.softquantus.com
π Authenticationβ
All requests require authentication via API Key in the header:
X-API-Key: your_api_key_here
Get your API Key at the SoftQuantus Portal.
π Endpoints Overviewβ
Licensesβ
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/licenses/generate | Generate new license |
POST | /api/v1/licenses/validate | Validate license |
GET | /api/v1/licenses | List licenses |
Customersβ
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/customers/me | Account information |
GET | /api/v1/customers/stats | Usage statistics |
Quantumβ
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/quantum/health | Quantum backend status |
POST | /api/v1/quantum/entropy | Generate quantum entropy |
POST | /api/v1/quantum/keys | Generate quantum key |
POST | /api/v1/quantum/rsa | Generate quantum RSA pair |
POST | /api/v1/quantum/crypto/encrypt | Encrypt with quantum key |
POST | /api/v1/quantum/crypto/decrypt | Decrypt |
POST | /api/v1/quantum/crypto/sign | Digital signature |
POST | /api/v1/quantum/crypto/verify | Verify signature |
POST | /api/v1/quantum/crypto/key-exchange | Key exchange |
Healthβ
| Method | Endpoint | Description |
|---|---|---|
GET | /health | Service health check |
π Licensesβ
POST /api/v1/licenses/generateβ
Generates a new quantum license for your end-customer.
Request Body:
{
"end_customer_id": "customer@company.com",
"features": ["premium", "api_access"],
"valid_days": 365,
"metadata": {
"company": "ACME Corp",
"plan": "enterprise"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
end_customer_id | string | β | Unique ID of your end customer |
features | string[] | List of features to enable | |
valid_days | integer | Validity in days (1-3650, default: 365) | |
metadata | object | Custom metadata |
Response (201 Created):
{
"license_key": "QLOCK-7A3F-9B2C-4E1D",
"quantum_signature": "a1b2c3d4e5f6...128_chars...789xyz",
"end_customer_id": "customer@company.com",
"features": ["premium", "api_access"],
"valid_until": "2026-12-26T15:30:00Z",
"quantum_verified": true,
"qcos_fidelity": 0.9987,
"security_level": "QUANTUM_SECURED",
"generated_at": "2025-12-26T15:30:00Z"
}
| Field | Type | Description |
|---|---|---|
license_key | string | Formatted license key |
quantum_signature | string | SHA3-512 quantum signature (128 hex chars) |
end_customer_id | string | End customer ID |
features | string[] | Enabled features |
valid_until | string | Expiration date (ISO 8601) |
quantum_verified | boolean | Uses real quantum entropy |
qcos_fidelity | number | Quantum fidelity (0.0-1.0) |
security_level | string | Security level |
generated_at | string | Generation timestamp |
Errors:
| Code | Description |
|---|---|
| 401 | Invalid API Key |
| 429 | Monthly limit reached |
| 500 | Internal error |
POST /api/v1/licenses/validateβ
Validates an existing license.
Request Body:
{
"license_key": "QLOCK-7A3F-9B2C-4E1D",
"end_customer_id": "customer@company.com"
}
Response (200 OK - Valid):
{
"valid": true,
"end_customer_id": "customer@company.com",
"quantum_verified": true,
"features": ["premium", "api_access"],
"expires_at": "2026-12-26T15:30:00Z",
"message": null
}
Response (200 OK - Invalid):
{
"valid": false,
"end_customer_id": "customer@company.com",
"quantum_verified": false,
"features": null,
"expires_at": null,
"message": "License has expired."
}
GET /api/v1/licensesβ
Lists all generated licenses.
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
skip | integer | 0 | Records to skip |
limit | integer | 100 | Maximum records |
Response:
{
"total": 150,
"skip": 0,
"limit": 100,
"licenses": [
{
"license_key": "QLOCK-7A3F-9B2C-4E1D",
"end_customer_id": "customer@company.com",
"features": ["premium"],
"valid_until": "2026-12-26T15:30:00Z",
"created_at": "2025-12-26T15:30:00Z"
}
]
}
π€ Customersβ
GET /api/v1/customers/meβ
Returns your account information.
Response:
{
"id": "cust_abc123",
"name": "ACME Corp",
"email": "admin@acme.com",
"plan": "business",
"created_at": "2025-01-01T00:00:00Z"
}
GET /api/v1/customers/statsβ
Returns usage statistics.
Response:
{
"plan": "business",
"licenses_generated_month": 4523,
"licenses_remaining_month": 95477,
"max_licenses_month": 100000,
"total_licenses_all_time": 45230,
"active_licenses": 38500
}
βοΈ Quantum APIβ
GET /api/v1/quantum/healthβ
Checks quantum backend status.
Response:
{
"available": true,
"backends": ["qcos_api", "qiskit_local", "cryptographic"],
"qcos_api": {
"available": true,
"url": "https://api.softquantus.com",
"latency_ms": 45
},
"qiskit_local": {
"available": true,
"simulator": "aer_simulator"
},
"test_result": {
"bits": 64,
"source": "qcos_api",
"entropy": "a7f3b2c1d4e5..."
}
}
POST /api/v1/quantum/entropyβ
Generates true quantum entropy.
Request:
{
"bits": 256,
"encoding": "hex",
"source": null
}
| Field | Type | Default | Description |
|---|---|---|---|
bits | integer | 256 | Entropy bits (1-4096) |
encoding | string | "hex" | Format: "hex", "base64", "raw" |
source | string | null | Force source: "qcos_api", "qiskit_local", "cryptographic" |
Response:
{
"entropy": "a7f3b2c1d4e5f6789abc0123456789abcdef...",
"bits": 256,
"source": "qcos_api",
"qubits": 16,
"fidelity": 0.9987,
"timestamp": "2025-12-26T15:30:00Z",
"job_id": "job_qcos_abc123"
}
POST /api/v1/quantum/crypto/encryptβ
Encrypts data with a quantum key.
Request:
{
"plaintext": "SGVsbG8gV29ybGQh",
"key_id": null,
"algorithm": "AES-256-GCM"
}
| Field | Type | Description |
|---|---|---|
plaintext | string | Data in Base64 |
key_id | string | Existing key ID (optional) |
algorithm | string | "AES-256-GCM" or "ChaCha20-Poly1305" |
Response:
{
"ciphertext": "encrypted_base64...",
"key_id": "key_quantum_abc123",
"iv": "initialization_vector_base64",
"tag": "auth_tag_base64",
"algorithm": "AES-256-GCM",
"quantum_secured": true
}
POST /api/v1/quantum/crypto/signβ
Creates a quantum digital signature.
Request:
{
"message": "bWVzc2FnZSB0byBzaWdu",
"key_id": null,
"algorithm": "SHA3-512-RSA"
}
Response:
{
"signature": "signature_base64...",
"key_id": "key_sign_abc123",
"public_key": "-----BEGIN PUBLIC KEY-----\n...",
"algorithm": "SHA3-512-RSA",
"quantum_nonce": "unique_nonce_for_replay_protection"
}
POST /api/v1/quantum/crypto/key-exchangeβ
Quantum key exchange protocol.
Flow:
- Party A calls without
peer_public_keyβ receivespublic_key - Party A sends
public_keyto Party B - Party B calls with
peer_public_keyβ receivesshared_secret - Party A calls with B's public key β same
shared_secret
Request (initiate):
{
"peer_public_key": null,
"key_bits": 256
}
Response:
{
"session_id": "session_abc123",
"public_key": "public_key_base64...",
"shared_secret": null
}
Request (complete):
{
"peer_public_key": "peer_public_key_base64...",
"key_bits": 256
}
Response:
{
"session_id": "session_xyz789",
"public_key": "my_public_key_base64...",
"shared_secret": "shared_secret_base64..."
}
π Rate Limitsβ
| Plan | Licenses/Month | Requests/Min |
|---|---|---|
| Free | 100 | 10 |
| Startup | 10,000 | 100 |
| Business | 100,000 | 1,000 |
| Enterprise | Unlimited | 10,000 |
Rate limit headers returned:
X-RateLimit-Limit: 100000
X-RateLimit-Remaining: 95477
X-RateLimit-Reset: 1735689600
β Error Codesβ
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API Key |
| 403 | Forbidden - No permission for this resource |
| 404 | Not Found - Resource not found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
| 503 | Service Unavailable - Quantum backend unavailable |
Error Format:
{
"detail": "Monthly limit reached (100000 licenses).",
"code": "RATE_LIMIT_EXCEEDED",
"timestamp": "2025-12-26T15:30:00Z"
}
π Securityβ
Recommended Headersβ
X-API-Key: your_api_key
Content-Type: application/json
Accept: application/json
Best Practicesβ
- Never expose your API Key in frontend code
- Use environment variables to store credentials
- Implement rate limiting in your backend
- Store licenses in a secure location on the client
- Use online validation when possible
- Implement caching to reduce API calls
π Supportβ
- Email: support@softquantus.com
- Portal: https://portal.softquantus.com
- Documentation: https://docs.softquantus.com
Β© 2025 SoftQuantus. All rights reserved.