---
title: "✨ Get refined prompt"
method: GET
path: "/api/prompts/{prompt_id}/versions/{version_id}/refine"
tags: ["Prompts"]
---

# ✨ Get refined prompt

`GET /api/prompts/{prompt_id}/versions/{version_id}/refine`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/prompts/{prompt_id}/versions/{version_id}/refine`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/humansignal/apis/label-studio-api/docs/api/prompts/:prompt_id/versions/:version_id/refine/get.ts> (a function with typed inputs; its response is checked against the schema)

<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>
Get the refined prompt based on the `refinement_job_id`.

## Path parameters

- `prompt_id` integer, required
- `version_id` integer, required

## Query parameters

- `refinement_job_id` string

## Response `200`

Refined prompt response

- RefinedPromptResponse
  - `previous_version` ThirdPartyModelVersion, required
    - `created_at` string, date-time, required
    - `created_by` UserSimple, required: A ModelSerializer that takes additional arguments for "fields", "omit" and "expand" in order to control which fields are displayed, and whether to replace simple values with complex, nested serializations
      - `avatar` string, nullable, required
      - `email` string, email
      - `first_name` string
      - `id` integer, required
      - `last_name` string
      - `username` string, required
    - `id` integer, required
    - `max_few_shot_examples` integer, nullable: Max number of few-shot examples to include in prompts. 0 = disabled.
    - `model_display_name` string, required: Human-readable model name derived from provider_model_id.
    - `model_provider_connection` integer, nullable
    - `organization` integer, nullable, required
    - `parent_model` integer: Parent model interface ID
    - `prompt` string, required: Prompt to execute
    - `provider` 'OpenAI' | 'AzureOpenAI' | 'AzureAIFoundry' | 'VertexAI' | 'Gemini' | 'Anthropic' | 'Custom': * `OpenAI` - OpenAI * `AzureOpenAI` - AzureOpenAI * `AzureAIFoundry` - AzureAIFoundry * `VertexAI` - VertexAI * `Gemini` - Gemini * `Anthropic` - Anthropic * `Custom` - Custom
    - `provider_model_id` string, required: The model ID to use within the given provider, e.g. gpt-3.5
    - `score` number, double, nullable, required
    - `title` string, required: Model name
    - `updated_at` string, date-time, required
  - `prompt` string, required: The refined prompt text
  - `reasoning` string, nullable, required: Reasoning behind the refinement
  - `refinement_job_id` string, nullable, required: Unique identifier for the refinement job
  - `refinement_status` string, nullable, required: Status of the refinement job
  - `title` string, nullable, required: Title of the refined prompt
  - `total_cost` string, nullable, required: Total cost of the refinement job (in USD)

## Other responses

- `202`: Refinement job status

## Changes

> 314 revisions in range; 1 not diffed.

- **2026-10-12** `b8379b6a8cda`: 4 info
  - the response optional property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/organization` became read-only for the status `200`
  - the response optional property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/organization` became read-only for the status `202`
  - the response property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/organization` became required for the status `200`
  - the response property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/organization` became required for the status `202`
- **2026-07-08** `b5f055b9d45b`: 6 breaking
  - the response property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/created_by/allOf[#/components/schemas/UserSimple]/avatar` became nullable for the status `200`
  - the response property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/created_by/allOf[#/components/schemas/UserSimple]/avatar` became nullable for the status `202`
  - the response property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/score` became nullable for the status `200`
  - the response property `previous_version/allOf[#/components/schemas/ThirdPartyModelVersion]/score` became nullable for the status `202`
  - …2 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/humansignal/apis/label-studio-api/changes/api/prompts/:prompt_id/versions/:version_id/refine/get.md)

---

[API](https://skmtc.dev/humansignal/apis/label-studio-api.md) - [All operations](https://skmtc.dev/humansignal/apis/label-studio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/humansignal/apis/label-studio-api/revisions/b2445d6cc12a?raw)
