Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Create optimization

POST/v1/private/optimizationsCreate optimization

Create optimization

Request body

application/json
objectOptimization_Write
dataset_namestringrequired

minLength 1

error_infoobject
Show child attributes
exception_typestringrequired

minLength 1

messagestring
tracebackstringrequired

minLength 1

idstring · uuid
last_updated_atstring · date-time
metadataobject
Show child attributes
anyOf · 3 options
Option 1object
Option 2array of object
Option 3string
namestring
objective_namestringrequired

minLength 1

project_idstring · uuid

Project ID. Takes precedence over project_name when both are provided.

project_namestring

Project name. Creates project if it doesn't exist. Ignored when project_id is provided.

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

statusstringrequired

one of "running", "completed", "cancelled", "initialized", "error"

studio_configobject
Show child attributes
dataset_namestringrequired

minLength 1

evaluationobjectrequired
Show child attributes
metricsarray of objectrequired

minItems 1

Show child attributes

minItems 1

Show array items
parametersobject
typestringrequired

minLength 1

llm_modelobjectrequired
Show child attributes
modelstringrequired

minLength 1

parametersobject
optimizerobjectrequired
Show child attributes
parametersobject
typestringrequired

minLength 1

promptobjectrequired
Show child attributes
messagesarray of objectrequired

minItems 1

Show child attributes

minItems 1

Show array items
contentstringrequired

minLength 1

rolestringrequired

minLength 1

Example request
{
  "dataset_name": "string",
  "error_info": {
    "exception_type": "string",
    "message": "string",
    "traceback": "string"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "last_updated_at": "2026-06-09T00:00:00Z",
  "metadata": {},
  "name": "string",
  "objective_name": "string",
  "project_id": "00000000-0000-0000-0000-000000000000",
  "project_name": "string",
  "status": "cancelled",
  "studio_config": {
    "dataset_name": "string",
    "evaluation": {
      "metrics": [
        {
          "parameters": {},
          "type": "string"
        }
      ]
    },
    "llm_model": {
      "model": "string",
      "parameters": {}
    },
    "optimizer": {
      "parameters": {},
      "type": "string"
    },
    "prompt": {
      "messages": [
        {
          "content": "string",
          "role": "string"
        }
      ]
    }
  }
}

Responses

201Created

Headers

Location
Documentation menu