v77

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-045764591.5 MB
Prompts

✨ 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.
post/api/prompts/{prompt_id}/versions/{version_id}/refine

Path parameters

prompt_idinteger required
version_idinteger required

Query parameters

asyncboolean

Whether to run the refinement asynchronously

Request body

project_idinteger required

Project ID to target the refined prompt for

teacher_model_namestring required

Name of the model to use to refine the prompt

teacher_model_provider_connection_idinteger required

Model Provider Connection ID to use to refine the prompt

Response

Refined prompt response

promptstring required

The refined prompt text

reasoningstring nullable required

Reasoning behind the refinement

refinement_job_idstring nullable required

Unique identifier for the refinement job

refinement_statusstring nullable required

Status of the refinement job

titlestring nullable required

Title of the refined prompt

total_coststring nullable required

Total cost of the refinement job (in USD)