✨ Refine a prompt version
<Card href="https://humansignal.com/goenterprise">
<img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
<p style="margin-top: 10px; font-size: 14px;">
This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
</p>
</Card>
Refine a prompt version using a teacher model and save the refined prompt as a new version.
Authentication
Authorizationstring
The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>
Path parameters
prompt_id
version_id
Query parameters
async
Whether to run the refinement asynchronously
Request
This endpoint expects an object.
project_id
Project ID to target the refined prompt for
teacher_model_name
Name of the model to use to refine the prompt
teacher_model_provider_connection_id
Model Provider Connection ID to use to refine the prompt
Response
Refined prompt response
previous_version
Previous version of the prompt
prompt
The refined prompt text
reasoning
Reasoning behind the refinement
refinement_job_id
Unique identifier for the refinement job
refinement_status
Status of the refinement job
title
Title of the refined prompt
total_cost
Total cost of the refinement job (in USD)