QuantumAPI

.NET SDK

Complete .NET SDK reference including DI integration, setup, and API clients.

Installation

dotnet add package QuantumAPI.Client

Configuration

using QuantumAPI.Client;

var client = new QuantumAPIClient("qapi_...");

Quick Example

var response = await client.Encryption.EncryptAsync(new EncryptRequest
{
    Plaintext = "hello quantum world",
    KeyId = "key_123"
});

Read the audit log

Lists key activity (encrypt, decrypt, sign, verify, key lifecycle) from GET /api/v1/audit-logs. Requires an API key with the audit:read scope (403 otherwise) or a signed-in tenant owner/admin, and platform 0.23.0 or later.

// needs an API key with the audit:read scope (ApiKeyScopes.AuditRead)
var page = await client.Audit.ListLogsAsync(new AuditLogQueryOptions
{
    Category = "keys",
    Actions = new[] { "Encrypt", "Decrypt" },
    PageSize = 100
});
foreach (var e in page.Items)
    Console.WriteLine($"{e.Timestamp:u} {e.Action} {e.Actor} {e.Outcome}");

Compliance, log archives and storage usage

Requires platform 0.27.0 or later. Compliance and log streams are for a tenant owner/admin (403 otherwise); storage usage works with any tenant role. Risk acceptances need a justification of 10-2000 characters and an optional future review date. Archive downloads return the raw gzip bytes (NDJSON, possibly several gzip members) without decompressing them and are audited. Storage figures are informative: not invoiced or enforced yet.

// Compliance (owner/admin)
var report = await client.Compliance.GetReportAsync(ComplianceFrameworks.Dora);
await client.Compliance.AcceptRiskAsync("dora", "operational-monitoring", new AcceptRiskRequest
{
    Justification = "Logs are shipped by our on-prem collector; SIEM integration planned for Q1.",
    ReviewDate = new DateTimeOffset(2027, 1, 31, 0, 0, 0, TimeSpan.Zero)
});
await client.Compliance.RevokeRiskAcceptanceAsync("dora", "operational-monitoring");
var history = await client.Compliance.ListRiskAcceptancesAsync();

// File log stream with daily archives (retention 7, 30 or 365 days)
var stream = await client.LogStreams.CreateAsync(CreateLogStreamRequest.ForFile("SIEM archive", retentionDays: 30));
var files = await client.LogStreams.ListFilesAsync(stream.Id);
await using var gz = await client.LogStreams.DownloadFileAsync(stream.Id, new DateOnly(2026, 10, 24)); // raw gzip
var path = await client.LogStreams.DownloadFileToAsync(stream.Id, "2026-10-24", "./archives");

// Storage occupied per category
var storage = await client.Billing.GetStorageUsageAsync();
Console.WriteLine($"{storage.TotalBytes} bytes, {storage.GbMonthsAccrued} GB-months");

Full API Reference

  • Encryption
  • Keys
  • Secrets
  • Users
  • Applications
  • EndUsers (incl. GenerateTemporaryPasswordAsync)
  • Audit
  • Billing (incl. GetStorageUsageAsync)
  • Compliance (GetOverviewAsync, GetReportAsync, AcceptRiskAsync, RevokeRiskAcceptanceAsync, ListRiskAcceptancesAsync)
  • LogStreams (incl. ListFilesAsync, DownloadFileAsync, DownloadFileToAsync)
  • Health
  • Qrng (GetEntropyAsync, Bytes / GetUuids / GetInt32Values / GetInt64Values)
.NET SDK | QuantumAPI Docs