curl --request POST \
--url https://api.example.com/api/v2/projects/{project_id}/prompt-optimization-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt_template_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_instructions": null,
"use_best_practices": true,
"use_labels": true,
"use_customer_feedback": true,
"run_test_after_optimization": true
}
'{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Creates an asynchronous job that optimizes the specified prompt template version. The job will analyze examples from the dataset and generate an improved prompt.
When run_test_after_optimization is True (default), the job will also run
baseline and optimized test runs and create a comparison.
Poll GET /prompt-optimization-jobs/ to check job status.
curl --request POST \
--url https://api.example.com/api/v2/projects/{project_id}/prompt-optimization-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt_template_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_instructions": null,
"use_best_practices": true,
"use_labels": true,
"use_customer_feedback": true,
"run_test_after_optimization": true
}
'{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.