Public beta · Explore your cloud workspacePlatform status ↗
CLOUDDORY DOCUMENTATION

API reference

Usage Calculator provides exact integer arithmetic behind organization-scoped access controls.

Authentication

Send Authorization: Bearer YOUR_API_KEY. Keys are scoped to one organization and can be revoked in the console. Customer sessions are not accepted as service credentials.

POST /v1/services/usage-calculator/quote

The customer website forwards /api/platform/services/usage-calculator/quote to this backend endpoint. Required JSON fields are units (0–10^9), free_units (0–10^9), and cents_per_unit (0–10^6). Values must be integers; booleans, strings, and decimals are rejected.

{"units":1250,"free_units":1000,"cents_per_unit":2}

Response

amount_cents is max(0, units − free_units) × cents_per_unit. No floating-point arithmetic is used. This is the calculated price you requested, not a Clouddory charge. One successful unique API request consumes one request from your plan.

{"amount_cents":500,"billable_units":250,"currency_unit":"cents"}

Idempotency

Idempotency-Key is required: 8–128 characters drawn from letters, digits, underscore, period, colon and hyphen. Retrying with the same body and key returns the saved result. Reusing a key with different input returns 409.

Error responses

401: invalid or revoked API key. 403: service not activated. 409: idempotency conflict. 422: input validation failed. 429: free quota or spending limit reached. 503: a required provider is not configured. Error bodies use the detail field.

Public beta: free service available. Paid billing and account recovery are not yet enabled.