Create evaluator
Creates a new evaluator with an initial version.
Payload Requirements
- The evaluator
namemust be unique within the given space. type(top-level) selects the evaluator kind:templateorcode. Withtemplate, provideversion.template_config. Withcode, provideversion.code_config— wherecode_config.typeismanagedorcustom(a separate discriminator withincode_config, independent of the top-leveltype: code).- For template evaluators:
version.template_config.nameis the eval column name; must match^[a-zA-Z0-9_\s\-&()]+$. - For template evaluators:
version.template_config.templateis the prompt template; use{variable}for placeholders (f-string format, e.g.{input},{output}). - For template evaluators:
version.template_config.classification_choicesmaps choice labels to numeric scores (e.g.{"relevant": 1, "irrelevant": 0}). When omitted, the evaluator produces freeform output. - For code evaluators: see
CodeConfig— managed evaluators (code_config.type: managed) usemanaged_evaluatorandvariables; custom evaluators (code_config.type: custom) usecode, optionalimports, andvariables. - System-managed fields (
id,created_at,updated_at,created_by_user_id) are rejected on input.
Valid example (template evaluator)
{
"name": "Hallucination Detector",
"space_id": "U3BhY2U6MTpWNEth",
"type": "template",
"version": {
"commit_message": "Initial version",
"template_config": {
"name": "hallucination",
"template": "Given the input: {input}\nand the output: {output}\nIs the output a hallucination?",
"include_explanations": true,
"use_function_calling_if_available": true,
"classification_choices": {"hallucinated": 0, "factual": 1},
"llm_config": {
"ai_integration_id": "TGxtSW50ZWdyYXRpb246MTI6YUJjRA==",
"model_name": "gpt-4o",
"invocation_parameters": {"temperature": 0},
"provider_parameters": {}
}
}
}
}
Invalid example (type/config mismatch — template type with code_config)
{
"name": "Bad Evaluator",
"space_id": "U3BhY2U6MTpWNEth",
"type": "template",
"version": {
"commit_message": "Wrong config",
"code_config": {
"type": "custom",
"name": "my_eval",
"code": "class Evaluator: ...",
"variables": ["input"]
}
}
}
Authorizations
Most Arize AI endpoints require authentication. For those endpoints that require authentication, include your API key in the request header using the format
Body
Body containing evaluator creation parameters with an initial version
Space identifier (base64)
Evaluator name (must be unique within the space)
The evaluator type: template (LLM-based) or code (managed built-in
evaluators or custom Python code — both are subtypes of code,
discriminated by the nested CodeConfig.type = managed | custom).
Applies to both the parent Evaluator.type field and every version's type
discriminator — a version's type must always match its parent evaluator's type.
template, code Payload for an evaluator version: exactly one of template_config or code_config.
Used both when creating an evaluator (initial version) and when appending a version.
- Option 1
- Option 2
Evaluator description
Response
Returns the created evaluator with its initial version
An evaluator defines reusable evaluation logic that can be attached to evaluation tasks. The type field determines the kind of evaluation: template (LLM-based template evaluation) or code (custom code evaluation).
The unique identifier for the evaluator
The name of the evaluator
The evaluator type: template (LLM-based) or code (managed built-in
evaluators or custom Python code — both are subtypes of code,
discriminated by the nested CodeConfig.type = managed | custom).
Applies to both the parent Evaluator.type field and every version's type
discriminator — a version's type must always match its parent evaluator's type.
template, code The unique identifier for the space the evaluator belongs to
When the evaluator was created
When the evaluator was last updated
The unique identifier for the user who created the evaluator
The resolved version of the evaluator
- Option 1
- Option 2
The description of the evaluator