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
| Field | Present when | Meaning |
|---|---|---|
valid | Always | Whether the gateway currently treats the deployment as licensed or in grace. |
state | Missing/invalid/floor key | Top-level floor marker for a missing or invalid license. |
reason | Missing/invalid key | Human-readable verifier reason, or missing. |
sub | Valid key | Licensed account or trial subject. |
tier | Valid key | License tier label such as trial or design-partner. |
features | Valid key | Feature strings the key enables. Absence denies the gated feature. |
limits | Valid key | Numeric entitlement limits. Missing keys are unlimited for that dimension. |
exp | Valid key | Key expiration timestamp. |
gateway.state | Always | licensed, grace, or floor for the gateway surface. |
gateway.seconds_to_deadline | Always | Seconds to exp while licensed, seconds to exp + grace while in grace, otherwise 0. |
gateway.grace_seconds_remaining | Always | Seconds 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 state | Gated route behavior | CE route behavior |
|---|---|---|
licensed | Feature-gated routes work if features includes the route’s feature. | Always works. |
grace | Feature-gated routes work and responses include x-hevlayer-license-grace: true. | Always works. |
floor | Feature-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"