Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Record experiment items in bulk

PUT/v1/private/experiments/items/bulkRecord experiment items in bulk

Record experiment items in bulk with traces, spans, and feedback scores. Maximum request size is 4MB.

Request body

application/json
objectExperimentItemBulkUpload_ExperimentItemBulkWriteView
dataset_namestringrequired

minLength 1

experiment_idstring · uuid

Optional experiment ID. If provided, items will be added to the existing experiment and experimentName will be ignored. If not provided or experiment with that ID doesn't exist, a new experiment will be created with the given experimentName

experiment_namestringrequired

minLength 1

itemsarray of objectrequired

maxItems 1000 · minItems 1

Show child attributes

maxItems 1000 · minItems 1

Show array items
dataset_item_idstring · uuidrequired
evaluate_task_resultobject
Show child attributes
anyOf · 3 options
Option 1object
Option 2array of object
Option 3string
feedback_scoresarray of object

maxItems 100 · minItems 0

Show child attributes

maxItems 100 · minItems 0

Show array items
category_namestring
created_atstring · date-time
created_bystring
last_updated_atstring · date-time
last_updated_bystring
namestringrequired

minLength 1

reasonstring
sourcestringrequired

one of "ui", "sdk", "online_scoring"

source_queue_idstring · uuid
valuenumberrequired

maximum 1000000000 · minimum -1000000000

value_by_authorobject
spansarray of object

maxItems 100 · minItems 0

Show child attributes

maxItems 100 · minItems 0

Show array items
end_timestring · date-time
environmentstring

maxLength 150 · minLength 0

error_infoobject
Show child attributes
exception_typestringrequired

minLength 1

messagestring
tracebackstringrequired

minLength 1

idstring · uuid
last_updated_atstring · date-time
modelstring
namestring
parent_span_idstring · uuid
providerstring
sourcestring

one of "sdk", "experiment", "playground", "optimization", "evaluator"

start_timestring · date-timerequired
tagsarray of string

uniqueItems true

Show child attributes

uniqueItems true

total_estimated_costnumber

minimum 0

total_estimated_cost_versionstring
ttftnumber · double

Time to first token in milliseconds

typestring

one of "general", "tool", "llm", "guardrail"

usageobject
traceobject

Please provide either none, only one of evaluate_task_result or trace, but never both

Show child attributes
end_timestring · date-time
environmentstring

maxLength 150 · minLength 0

idstring · uuid
last_updated_atstring · date-time
namestring
project_namestring

If null, the default project is used

pattern (?s)^\s*(\S.*\S|\S)\s*$

sourcestring

one of "sdk", "experiment", "playground", "optimization", "evaluator"

start_timestring · date-timerequired
tagsarray of string

uniqueItems true

Show child attributes

uniqueItems true

thread_idstring
ttftnumber · double

Time to first token in milliseconds

project_namestring

Project for traces auto-created from items that provide evaluate_task_result (i.e. without an explicit trace). If null, the default project is used; relying on this fallback is deprecated, please provide project_name explicitly.

pattern (?s)^\s*(\S.*\S|\S)\s*$

Example request
{
  "dataset_name": "string",
  "experiment_id": "00000000-0000-0000-0000-000000000000",
  "experiment_name": "string",
  "items": [
    {
      "dataset_item_id": "00000000-0000-0000-0000-000000000000",
      "evaluate_task_result": {},
      "feedback_scores": [
        {
          "category_name": "string",
          "name": "string",
          "reason": "string",
          "source": "online_scoring",
          "source_queue_id": "00000000-0000-0000-0000-000000000000",
          "value": 0
        }
      ],
      "spans": [
        {
          "end_time": "2026-06-09T00:00:00Z",
          "environment": "string",
          "error_info": {
            "exception_type": "string",
            "message": "string",
            "traceback": "string"
          },
          "id": "00000000-0000-0000-0000-000000000000",
          "input": {},
          "last_updated_at": "2026-06-09T00:00:00Z",
          "metadata": {},
          "model": "string",
          "name": "string",
          "output": {},
          "parent_span_id": "00000000-0000-0000-0000-000000000000",
          "provider": "string",
          "source": "evaluator",
          "start_time": "2026-06-09T00:00:00Z",
          "tags": [
            "string"
          ],
          "total_estimated_cost": 0,
          "total_estimated_cost_version": "string",
          "ttft": 0,
          "type": "general",
          "usage": {
            "additionalProp1": 0
          }
        }
      ],
      "trace": {
        "end_time": "2026-06-09T00:00:00Z",
        "environment": "string",
        "error_info": {
          "exception_type": "string",
          "message": "string",
          "traceback": "string"
        },
        "id": "00000000-0000-0000-0000-000000000000",
        "input": {},
        "last_updated_at": "2026-06-09T00:00:00Z",
        "metadata": {},
        "name": "string",
        "output": {},
        "project_name": "string",
        "source": "evaluator",
        "start_time": "2026-06-09T00:00:00Z",
        "tags": [
          "string"
        ],
        "thread_id": "string",
        "ttft": 0
      }
    }
  ],
  "project_name": "string"
}

Responses

204No content
400Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
409Conflictapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
422Unprocessable Contentapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu