Skip to main content
POST
/
api
/
v2
/
projects
/
{project_id}
/
prompt-optimization-jobs
Start a new prompt optimization job.
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"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

project_id
string
required

Body

application/json
prompt_template_version_id
string<uuid>
required
dataset_id
string<uuid>
required
user_instructions
string | null
use_best_practices
boolean
default:true
use_labels
boolean
default:true
use_customer_feedback
boolean
default:true
run_test_after_optimization
boolean
default:true

Response

202 - application/json

PromptOptimizationJobCreatedResponse(job_id: uuid.UUID, status: str, created_at: datetime.datetime)

job_id
string<uuid>
required
status
string
required
created_at
string<date-time>
required