Repository Public
1> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.23## Update an eval45**post** `/evals/{eval_id}`67Update certain properties of an evaluation.89### Path Parameters1011- `eval_id: string`1213### Body Parameters1415- `metadata: optional Metadata or null`1617 Set of 16 key-value pairs that can be attached to an object. This can be18 useful for storing additional information about the object in a structured19 format, and querying for objects via API or the dashboard.2021 Keys are strings with a maximum length of 64 characters. Values are strings22 with a maximum length of 512 characters.2324- `name: optional string`2526 Rename the evaluation.2728### Returns2930- `id: string`3132 Unique identifier for the evaluation.3334- `created_at: number`3536 The Unix timestamp (in seconds) for when the eval was created.3738- `data_source_config: EvalCustomDataSourceConfig or object { schema, type, metadata } or EvalStoredCompletionsDataSourceConfig`3940 Configuration of data sources used in runs of the evaluation.4142 - `EvalCustomDataSourceConfig object { schema, type }`4344 A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.45 The response schema defines the shape of the data that will be:4647 - Used to define your testing criteria and48 - What data is required when creating a run4950 - `schema: map[unknown]`5152 The json schema for the run data source items.53 Learn how to build JSON schemas [here](https://json-schema.org/).5455 - `type: "custom"`5657 The type of data source. Always `custom`.5859 - `"custom"`6061 - `LogsDataSourceConfig object { schema, type, metadata }`6263 A LogsDataSourceConfig which specifies the metadata property of your logs query.64 This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.65 The schema returned by this data source config is used to defined what variables are available in your evals.66 `item` and `sample` are both defined when using this data source config.6768 - `schema: map[unknown]`6970 The json schema for the run data source items.71 Learn how to build JSON schemas [here](https://json-schema.org/).7273 - `type: "logs"`7475 The type of data source. Always `logs`.7677 - `"logs"`7879 - `metadata: optional Metadata or null`8081 Set of 16 key-value pairs that can be attached to an object. This can be82 useful for storing additional information about the object in a structured83 format, and querying for objects via API or the dashboard.8485 Keys are strings with a maximum length of 64 characters. Values are strings86 with a maximum length of 512 characters.8788 - `EvalStoredCompletionsDataSourceConfig object { schema, type, metadata }`8990 Deprecated in favor of LogsDataSourceConfig.9192 - `schema: map[unknown]`9394 The json schema for the run data source items.95 Learn how to build JSON schemas [here](https://json-schema.org/).9697 - `type: "stored_completions"`9899 The type of data source. Always `stored_completions`.100101 - `"stored_completions"`102103 - `metadata: optional Metadata or null`104105 Set of 16 key-value pairs that can be attached to an object. This can be106 useful for storing additional information about the object in a structured107 format, and querying for objects via API or the dashboard.108109 Keys are strings with a maximum length of 64 characters. Values are strings110 with a maximum length of 512 characters.111112- `metadata: Metadata or null`113114 Set of 16 key-value pairs that can be attached to an object. This can be115 useful for storing additional information about the object in a structured116 format, and querying for objects via API or the dashboard.117118 Keys are strings with a maximum length of 64 characters. Values are strings119 with a maximum length of 512 characters.120121- `name: string`122123 The name of the evaluation.124125- `object: "eval"`126127 The object type.128129 - `"eval"`130131- `testing_criteria: array of LabelModelGrader or StringCheckGrader or TextSimilarityGrader or 2 more`132133 A list of testing criteria.134135 - `LabelModelGrader object { input, labels, model, 3 more }`136137 A LabelModelGrader object which uses a model to assign labels to each item138 in the evaluation.139140 - `input: array of object { content, role, type }`141142 - `content: string or ResponseInputText or object { text, type } or 3 more`143144 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.145146 - `TextInput = string`147148 A text input to the model.149150 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`151152 A text input to the model.153154 - `text: string`155156 The text input to the model.157158 - `type: "input_text"`159160 The type of the input item. Always `input_text`.161162 - `"input_text"`163164 - `prompt_cache_breakpoint: optional object { mode }`165166 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.167168 - `mode: "explicit"`169170 The breakpoint mode. Always `explicit`.171172 - `"explicit"`173174 - `OutputText object { text, type }`175176 A text output from the model.177178 - `text: string`179180 The text output from the model.181182 - `type: "output_text"`183184 The type of the output text. Always `output_text`.185186 - `"output_text"`187188 - `InputImage object { image_url, type, detail }`189190 An image input block used within EvalItem content arrays.191192 - `image_url: string`193194 The URL of the image input.195196 - `type: "input_image"`197198 The type of the image input. Always `input_image`.199200 - `"input_image"`201202 - `detail: optional string`203204 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.205206 - `ResponseInputAudio object { input_audio, type }`207208 An audio input to the model.209210 - `input_audio: object { data, format }`211212 - `data: string`213214 Base64-encoded audio data.215216 - `format: "mp3" or "wav"`217218 The format of the audio data. Currently supported formats are `mp3` and219 `wav`.220221 - `"mp3"`222223 - `"wav"`224225 - `type: "input_audio"`226227 The type of the input item. Always `input_audio`.228229 - `"input_audio"`230231 - `GraderInputs = array of string or ResponseInputText or object { text, type } or 2 more`232233 A list of inputs, each of which may be either an input text, output text, input234 image, or input audio object.235236 - `TextInput = string`237238 A text input to the model.239240 - `ResponseInputText object { text, type, prompt_cache_breakpoint }`241242 A text input to the model.243244 - `OutputText object { text, type }`245246 A text output from the model.247248 - `text: string`249250 The text output from the model.251252 - `type: "output_text"`253254 The type of the output text. Always `output_text`.255256 - `"output_text"`257258 - `InputImage object { image_url, type, detail }`259260 An image input block used within EvalItem content arrays.261262 - `image_url: string`263264 The URL of the image input.265266 - `type: "input_image"`267268 The type of the image input. Always `input_image`.269270 - `"input_image"`271272 - `detail: optional string`273274 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.275276 - `ResponseInputAudio object { input_audio, type }`277278 An audio input to the model.279280 - `role: "user" or "assistant" or "system" or "developer"`281282 The role of the message input. One of `user`, `assistant`, `system`, or283 `developer`.284285 - `"user"`286287 - `"assistant"`288289 - `"system"`290291 - `"developer"`292293 - `type: optional "message"`294295 The type of the message input. Always `message`.296297 - `"message"`298299 - `labels: array of string`300301 The labels to assign to each item in the evaluation.302303 - `model: string`304305 The model to use for the evaluation. Must support structured outputs.306307 - `name: string`308309 The name of the grader.310311 - `passing_labels: array of string`312313 The labels that indicate a passing result. Must be a subset of labels.314315 - `type: "label_model"`316317 The object type, which is always `label_model`.318319 - `"label_model"`320321 - `StringCheckGrader object { input, name, operation, 2 more }`322323 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.324325 - `input: string`326327 The input text. This may include template strings.328329 - `name: string`330331 The name of the grader.332333 - `operation: "eq" or "ne" or "like" or "ilike"`334335 The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.336337 - `"eq"`338339 - `"ne"`340341 - `"like"`342343 - `"ilike"`344345 - `reference: string`346347 The reference text. This may include template strings.348349 - `type: "string_check"`350351 The object type, which is always `string_check`.352353 - `"string_check"`354355 - `TextSimilarityGrader = TextSimilarityGrader`356357 A TextSimilarityGrader object which grades text based on similarity metrics.358359 - `pass_threshold: number`360361 The threshold for the score.362363 - `PythonGrader = PythonGrader`364365 A PythonGrader object that runs a python script on the input.366367 - `pass_threshold: optional number`368369 The threshold for the score.370371 - `ScoreModelGrader = ScoreModelGrader`372373 A ScoreModelGrader object that uses a model to assign a score to the input.374375 - `pass_threshold: optional number`376377 The threshold for the score.378379### Example380381```http382curl https://api.openai.com/v1/evals/$EVAL_ID \383 -H 'Content-Type: application/json' \384 -H "Authorization: Bearer $OPENAI_API_KEY" \385 -d '{}'386```387388#### Response389390```json391{392 "id": "id",393 "created_at": 0,394 "data_source_config": {395 "schema": {396 "foo": "bar"397 },398 "type": "custom"399 },400 "metadata": {401 "foo": "string"402 },403 "name": "Chatbot effectiveness Evaluation",404 "object": "eval",405 "testing_criteria": [406 {407 "input": [408 {409 "content": "string",410 "role": "user",411 "type": "message"412 }413 ],414 "labels": [415 "string"416 ],417 "model": "model",418 "name": "name",419 "passing_labels": [420 "string"421 ],422 "type": "label_model"423 }424 ]425}426```427428### Example429430```http431curl https://api.openai.com/v1/evals/eval_67abd54d9b0081909a86353f6fb9317a \432 -H "Authorization: Bearer $OPENAI_API_KEY" \433 -H "Content-Type: application/json" \434 -d '{"name": "Updated Eval", "metadata": {"description": "Updated description"}}'435```436437#### Response438439```json440{441 "object": "eval",442 "id": "eval_67abd54d9b0081909a86353f6fb9317a",443 "data_source_config": {444 "type": "custom",445 "schema": {446 "type": "object",447 "properties": {448 "item": {449 "type": "object",450 "properties": {451 "input": {452 "type": "string"453 },454 "ground_truth": {455 "type": "string"456 }457 },458 "required": [459 "input",460 "ground_truth"461 ]462 }463 },464 "required": [465 "item"466 ]467 }468 },469 "testing_criteria": [470 {471 "name": "String check",472 "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2",473 "type": "string_check",474 "input": "{{item.input}}",475 "reference": "{{item.ground_truth}}",476 "operation": "eq"477 }478 ],479 "name": "Updated Eval",480 "created_at": 1739314509,481 "metadata": {"description": "Updated description"},482}483```484