Create Eval Grader
Create a grader in the project catalog. Attach it to a prompt with Update Prompt Eval Settings, or pass its name to Create Eval Run.
Create a grader in the project catalog. Attach it to a prompt with Update Prompt Eval Settings, or pass its name to Create Eval Run.
https://statsigapi.net/console/v1/eval_gradersAuthorizations
STATSIG-API-KEYstringrequiredapiKey (header)
Body
application/jsonnamestringrequiredGrader name, unique in the project.
min length: 1promptobjectrequiredShow child attributes
typestringrequiredlabel_model is an LLM judge over {{output}} (content is the rubric); string_check compares {{output}} to a dataset column with operation; text_similarity scores {{output}} against a column with evaluation_metric; python runs source.
label_modelstring_checktext_similaritypythoncontentstringRubric for label_model. May reference {{output}} and dataset columns.
nullableoperationstringeqnelikeilikenullableevaluation_metricstringSimilarity measure for text_similarity.
fuzzy_matchbleugleumeteorrouge_1rouge_2rouge_3rouge_4rouge_5rouge_lcosinenullablecolumnstringDataset column compared against for string_check and text_similarity.
nullablesourcestringPython source for a python grader.
nullableevalModelstringOpenAI model that judges a label_model grader, such as gpt-5-mini. Other grader types ignore it. An unsupported model returns a 400. Defaults to gpt-5-mini on create; omit it on update to keep the current model.
min length: 1Response
application/jsonmessagestringrequiredA simple string explaining the result of the operation.
dataobjectrequiredShow child attributes
idstringrequirednamestringrequiredtypestringrequiredGrader type: label_model, string_check, text_similarity, python, completion_tokens, completion_latency, or logged_score.
isGlobalbooleanrequiredpromptoneOfrequiredobjecttypestringrequiredlabel_modelcontentstringrequiredevalModelstringrequiredOpenAI model that judges a label_model grader. Other grader types ignore it.
choiceScoresobjectrequirednullablegradingRulesobject[]requiredOrdered online grading rules. For each span, the first enabled rule that matches decides whether the grader scores it.
idstringrequiredenabledbooleanrequiredconditionsobject[]requiredCombined with AND. A rule with no conditions matches every span.
fieldstringrequiredSpan field to match: ai_config (AI config IDs, matched by the config name), config_version (version IDs), environment (statsig.environment), span_name, agent_name (gen_ai.agent.name), model (gen_ai.request.model), or span_attribute (the attribute named by key).
ai_configconfig_versionenvironmentspan_nameagent_namemodelspan_attributekeystringAttribute name of a span_attribute condition.
operatorstringrequiredis matches any of the values exactly and is_not matches none of them. A span without the field reads as an empty string.
isis_notvaluesstring[]requiredsamplingRatenumberrequiredPercentage of matching traces to grade, from 0 to 100. Sampling is by trace ID, so every span of a trace gets the same decision.
min: 0max: 100offlineTargetsoneOf[]requiredAI configs and datasets the grader scores in offline evals. A version evaluation of an AI config runs its graders and its dataset's graders. An eval run on a dataset always includes that dataset's graders.
typestringrequiredai_configaiConfigIDstringrequiredisCriticalbooleanrequiredcreatedTimenumberrequiredformat: doublelastModifiedTimenumberrequiredformat: doublestatusintegerrequired400messagestringrequiredWas this helpful?
For AI agents: a documentation index is available at /llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.