License

GET /v1/license

Retrieve your current license information and credit balance. This is a read-only endpoint that does not consume credits.

Headers

Header Required Description
Authorization Yes Bearer <api-key-or-jwt>

Request

No request body. This is a GET endpoint.

Examples

cURL
Python
curl https://api.quantized.us/v1/license \
  -H "Authorization: Bearer sk-quantized-YOUR-KEY"
import httpx

response = httpx.get(
    "https://api.quantized.us/v1/license",
    headers={"Authorization": "Bearer sk-quantized-YOUR-KEY"},
)
info = response.json()
lifetime = info["budget"]["lifetime"] if info.get("budget") else None
if lifetime:
    print(f"Used: {lifetime['used']} micro-credits")
    print(f"Remaining: {lifetime['remaining']} micro-credits")

Response

{
  "institution_id": "550e8400-e29b-41d4-a716-446655440000",
  "license_type_id": "660e8400-e29b-41d4-a716-446655440001",
  "license_id": "770e8400-e29b-41d4-a716-446655440002",
  "unique_id": "user-123",
  "budget": {
    "wallet_kind": "credit",
    "unit": "micro_credit",
    "strategy": "lifetime",
    "lifetime": {
      "used": 150000,
      "limit": 1000000,
      "adjustment": 0,
      "remaining": 850000,
      "window_start_at": null
    },
    "periods": {}
  },
  "policy": null
}

Response fields

Field Type Description
institution_id string Your institution’s UUID
license_type_id string License type UUID
license_id string Your specific license UUID
unique_id string or null Caller-supplied unique identifier (e.g. user ID or course enrollment ID)
budget object or null Credit budget snapshot: used, limit, remaining, and period breakdown for this license. null when no wallet is configured
policy object or null Policy document controlling endpoint access for this license type. null means unrestricted

Errors

Status Code Condition
400 invalid_request Malformed X-Quantized-Provider header
400 invalid_metadata_header Invalid X-Quantized-Metadata header
401 missing_api_key, invalid_api_key, api_key_expired, license_inactive Missing, invalid, or expired API key, or an inactive license
500 internal_error Unexpected error

Every error uses the standard error body. Branch on the status and code; see the Error reference for each.