Kaiten
API ReferenceOpenFeature (OFREP)

Evaluate Flags

Single and bulk flag evaluation via the OFREP API.

Evaluate Flags

Single Flag Evaluation

POST /api/ofrep/v1/evaluate/flags/{flagKey}
Authorization: Bearer ksh_xxx
Content-Type: application/json

Request Body

{
  "context": {
    "tenantSlug": "sakura-tokyo",
    "orderCount": 42,
    "region": "us-east"
  }
}

Response

{
  "key": "delivery-tracking-enabled",
  "value": true,
  "variant": "on",
  "reason": "TARGETING_MATCH",
  "metadata": {}
}

Evaluation Reasons

ReasonDescription
DEFAULTNo targeting rule matched, default variant returned
TARGETING_MATCHA targeting rule matched
DISABLEDFlag is disabled
ERROREvaluation error (flag not found, invalid context)

Bulk Evaluation

Evaluate all flags at once:

POST /api/ofrep/v1/evaluate/flags
Authorization: Bearer ksh_xxx
Content-Type: application/json

Request Body

{
  "context": {
    "tenantSlug": "sakura-tokyo"
  }
}

Response

{
  "flags": [
    {
      "key": "delivery-tracking-enabled",
      "value": true,
      "variant": "on",
      "reason": "TARGETING_MATCH"
    },
    {
      "key": "analytics-dashboard-enabled",
      "value": false,
      "variant": "off",
      "reason": "DEFAULT"
    }
  ]
}

Context Variables

You can pass any key-value pair in the context object. Common variables:

VariableDescription
tenantSlugThe instance slug — used for per-tenant targeting
orderCountA numeric metric — used for threshold-based targeting
regionGeographic region — used for geographic targeting
userIdEnd user identifier — used for user-level targeting

CEL targeting rules reference these variables directly: tenantSlug == "sakura-tokyo" && orderCount > 10

On this page