Refine a prompt version

POST

Refine a prompt version using a teacher model and save the refined prompt as a new version.

Path parameters

prompt_idintegerRequired

Prompt ID

version_idintegerRequired

Base Prompt Version ID

Query parameters

asyncbooleanOptional

Run the refinement job asynchronously

Request

This endpoint expects an object.
teacher_model_provider_connection_idintegerOptional

Model Provider Connection ID to use to refine the prompt

teacher_model_namestringOptional

Name of the model to use to refine the prompt

project_idintegerOptional

Project ID to target the refined prompt for

Response

This endpoint returns an object.
promptstring

The refined prompt text

titlestringOptional

Title of the refined prompt

reasoningstringOptional

Reasoning behind the refinement

refinement_job_idstringOptional

Unique identifier for the refinement job

refinement_statusenumOptionalDefaults to Pending
Allowed values: PendingInProgressCompletedFailed

Status of the refinement job

total_coststringOptional

Total cost of the refinement job (in USD)

previous_versionobjectOptional

Previous version of the prompt