Authentication
The evaluate endpoint accepts a Bearer API-key token, so any external application can call it - no dashboard login needed.Request fields
Required:entity_type- one ofcontext,prompt, orevaluation.fields- a flat key-value map of the current input values to check against your rules’ conditions (e.g.{"model": "gpt-4", "user_tier": "premium"}). Up to 50 fields.
include_entity_data- set totrueto get full entity records back in the response, not just IDs.entity_inputs- extra, per-entity-type options. For example, when retrieving aprompt, you can passvariablesandshouldCompileto get the prompt back with its{{variableName}}placeholders filled in.
Response shape
matchingRuleIds- the IDs of the rules that matched.entities- references to each matched rule’s linked entities.entity_data- present only ifinclude_entity_datawas set, keyed by"{entity_type}:{entity_id}"with the full record. Full entity data is currently only populated forcontextandpromptentity types, not forevaluation.
Create an API key
- Navigate to Settings → API Keys in OpenLIT.
- Click Create API Key, enter a name, and save the key securely.
Call the evaluate endpoint
Send aPOST to /api/rule-engine/evaluate. The full code examples and request/response schema live in two places, depending on what you need:
SDK Rule Engine
Python, TypeScript, and Go examples for retrieving contexts, prompts, and evaluation configs, plus full parameter tables and error handling
API Reference: Evaluate
Full request/response schema and a curl example, with a live “try it” playground

