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
version_idintegerRequired

Headers

AuthorizationstringRequired

Header authentication of the form Token <token>

Query parameters

asyncbooleanOptional
Whether to run the refinement asynchronously

Request

This endpoint expects an object.
project_idintegerRequired
Project ID to target the refined prompt for
teacher_model_namestringRequired>=1 character
Name of the model to use to refine the prompt
teacher_model_provider_connection_idintegerRequired
Model Provider Connection ID to use to refine the prompt

Response

Refined prompt response
promptstring
The refined prompt text
previous_versionobject or null
Previous version of the prompt
reasoningstring or null
Reasoning behind the refinement
refinement_job_idstring or null
Unique identifier for the refinement job
refinement_statusstring or null
Status of the refinement job
titlestring or null
Title of the refined prompt
total_coststring or null

Total cost of the refinement job (in USD)