Refine a prompt version

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

Headers

AuthorizationstringRequired

Header authentication of the form Token <token>

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

promptstring
The refined prompt text
titlestring or null
Title of the refined prompt
reasoningstring or null
Reasoning behind the refinement
refinement_job_idstring or null
Unique identifier for the refinement job
refinement_statusenum or nullDefaults to Pending
Status of the refinement job
Allowed values:
total_coststring or null

Total cost of the refinement job (in USD)

previous_versionobject or null
Previous version of the prompt