API

License

GET /v2/license returns the gateway’s local license projection. It is an operator and dashboard oracle: it never phones home, and it derives state from the configured license key plus the gateway’s codified grace cushion.

curl "$LAYER_GATEWAY_URL/v2/license" \
  -H "Authorization: Bearer $LAYER_GATEWAY_API_KEY"

Response

A valid key that is still within its licensed or grace window returns valid: true and the key claims the gateway is using:

{
  "valid": true,
  "sub": "acme-corp",
  "tier": "design-partner",
  "features": ["transform-runtime", "agents", "rbac", "warehouses", "doc-cache", "history", "cost"],
  "limits": {"namespaces": 50, "udf_workers": 20},
  "exp": "2026-12-14T00:00:00Z",
  "gateway": {
    "state": "licensed",
    "seconds_to_deadline": 1209600,
    "grace_seconds_remaining": 0
  }
}

When the key is expired but still inside the gateway grace window, gateway.state is grace, valid remains true, and grace_seconds_remaining counts down to the floor.

Missing, invalid, or fully degraded licenses return valid: false:

{
  "valid": false,
  "state": "floor",
  "reason": "missing",
  "gateway": {
    "state": "floor",
    "seconds_to_deadline": 0,
    "grace_seconds_remaining": 0
  }
}

Invalid keys use reason to report the verifier failure. Missing keys use reason: "missing".

Fields

FieldPresent whenMeaning
validAlwaysWhether the gateway currently treats the deployment as licensed or in grace.
stateMissing/invalid/floor keyTop-level floor marker for a missing or invalid license.
reasonMissing/invalid keyHuman-readable verifier reason, or missing.
subValid keyLicensed account or trial subject.
tierValid keyLicense tier label such as trial or design-partner.
featuresValid keyFeature strings the key enables. Absence denies the gated feature.
limitsValid keyNumeric entitlement limits. Missing keys are unlimited for that dimension.
expValid keyKey expiration timestamp.
gateway.stateAlwayslicensed, grace, or floor for the gateway surface.
gateway.seconds_to_deadlineAlwaysSeconds to exp while licensed, seconds to exp + grace while in grace, otherwise 0.
gateway.grace_seconds_remainingAlwaysSeconds left in gateway grace, otherwise 0.

Phase 1 reports the gateway surface. Operator and dashboard states use the same licensed / grace / floor model, but they are not included in this response until their enforcement surfaces ship.

State Effects

Gateway stateGated route behaviorCE route behavior
licensedFeature-gated routes work if features includes the route’s feature.Always works.
graceFeature-gated routes work and responses include x-hevlayer-license-grace: true.Always works.
floorFeature-gated routes return 402 with error: "license_required".Always works.

The CE floor includes query, point read, write, scan, namespace metadata, snapshot, and backend routing routes.

Client Call

state = await client.get_license()
print(state.gateway.state)
state, err := client.GetLicense(ctx)
if err != nil {
    return err
}
fmt.Println(state.Gateway.State)
const state = await client.getLicense();
console.log(state.gateway.state);
curl "$LAYER_GATEWAY_URL/v2/license" \
  -H "Authorization: Bearer $LAYER_GATEWAY_API_KEY"
esc