Skip to content

5. Pilot packet ​

Version: 1.0 · Production API: https://api.quantzk.com
Binding: bn128-poseidon8-v1 (Phase-2 in-circuit) · Full packet: ../QUANTZK_VERIFIABLE_BILLING_PILOT_PACKET.pdf


Problem ​

Usage-based API billing breaks at the trust boundary between meter, tariff, and invoice.

PainWhat teams experience
Dispute archaeologyFinance reconstructs charges from logs, Stripe, spreadsheets — days per ticket
No portable proofNothing cryptographically links this usage event to this line-item charge
Enterprise frictionProcurement wants verifiable audit trails, not dashboards
Replay and driftDuplicate event IDs and tariff changes create silent mismatches

QuantZK workflow ​

Two HTTP calls. Same surface before and after Phase-2.

POST /api/vdi/billing/attest   →  signed bundle (meter + tariff + charge + receipt)
POST /api/vdi/billing/verify   →  pass/fail + incircuit_binding_verification

Bundle fields ​

FieldRole
meter_eventIdempotent event_id, usage units, tenant, window
tariff_snapshotPinned price, min/max, rounding at issuance
billing.expected_charge_microsDeterministic charge
billing.billing_verify_fingerprintReconciliation fingerprint
attestation + receiptVDI signed decision + verification receipt
attestation.billing_proofPhase-2 Groth16 binding (additive)

Trust infrastructure (production) ​

EndpointStatus
GET /.well-known/vdi-billing-revocation.json200
GET /api/vdi/billing/transparency/head200
GET /api/vdi/statusoperational
GET /healthenvironment: production

Integration (10 minutes) ​

Step 1 — Attest after metering ​

bash
curl -sS -X POST "https://api.quantzk.com/api/vdi/billing/attest" \
  -H "Content-Type: application/json" \
  -H "X-VDI-Attest-Secret: $VDI_ATTEST_SECRET" \
  -d '{
    "billing_version": "v2",
    "profileId": "VDI_VERIFY_STANDARD_V1",
    "meter_event": {
      "event_id": "evt_pilot_001",
      "event_timestamp": "2026-05-29T12:00:00.000Z",
      "tenant_id": "tenant_acme",
      "api_key_id": "api_live_001",
      "endpoint": "/v1/completions",
      "usage_units": 1842,
      "contract_version": "contract-v1",
      "billing_window_id": "2026-05"
    },
    "tariff_snapshot": {
      "tariff_id": "tariff_default",
      "tariff_version": "1.0.0",
      "tariff_class": "usage_linear",
      "unit_price_micros": 120,
      "min_charge_micros": 50000,
      "max_charge_micros": 5000000000,
      "rounding_mode": "floor",
      "currency": "USD"
    }
  }' | jq .

Store the full JSON response.

Step 2 — Verify on dispute ​

bash
curl -sS -X POST "https://api.quantzk.com/api/vdi/billing/verify" \
  -H "Content-Type: application/json" \
  -d @verify-body.json | jq .

verify-body.json includes attestation, receipt, billed_billing_v2, and expected_billing_v2 from step 1.

Step 3 — Wire into stack ​

  1. Call /attest once per billable event (unique event_id).
  2. Persist bundle next to invoice line or ledger entry.
  3. On dispute or month-end close, call /verify.

Dispute resolution (worked example) ​

Scenario: Customer disputes $221.04 for 1,842 completion units.

Verify (valid bundle):

json
{
  "verification": { "valid": true },
  "billing_check": { "valid": true },
  "incircuit_binding_verification": {
    "valid": true,
    "binding_version": "bn128-poseidon8-v1",
    "commitment_digest": "17482494435685096671389889045805694801134018277950430849590868584772755507057"
  }
}

Tamper (modified tariff): incircuit_binding_verification.valid → false. Fail closed.

Resolution time: minutes, not days. Evidence: JSON bundle + verify response.


Pilot scope ​

ParameterValue
Duration2–4 weeks
EndpointsOne high-volume billable API route
TariffOne tariff line
ProfileVDI_VERIFY_STANDARD_V1
Success metricsDispute MTTR, reconciliation match rate, security sign-off

ROI (conservative) ​

VariableExample
Disputes / month20
Hours per dispute4
Blended hourly cost$150
Monthly dispute cost (today)$12,000
With verify receipts~$1,500 (~0.5 hr each)
Monthly savings~$10,500

Pilot integration: ~1–2 engineering days. Break-even often in first billing cycle at material dispute volume.


References ​

DocumentPath
Full pilot packet (markdown)../QUANTZK_VERIFIABLE_BILLING_PILOT_PACKET.md
Pilot runbook../../../protocol/docs/api-billing-pilot.md
Production deploy../../../protocol/docs/api-billing-production.md
Smoke scriptscripts/smoke-billing-phase2.sh

Contact: Omar@quantzk.com · Trust index: quantzk.com/trust

QuantZK Control docs: gateway, reconciliation, and optional portable evidence.