Label Studio Subpackage Prompts.subpackage Prompts/versions API

The subpackage_prompts.subpackage_prompts/versions API from Label Studio — 5 operation(s) for subpackage_prompts.subpackage_prompts/versions.

Operations 9

GET /api/prompts/{id}/get-default-version-name ✨ Get default prompt version name #
GET /api/prompts/{prompt_id}/versions ✨ List prompt versions #
POST /api/prompts/{prompt_id}/versions ✨ Create prompt version #
GET /api/prompts/{prompt_id}/versions/{version_id} ✨ Get prompt version #
DELETE /api/prompts/{prompt_id}/versions/{version_id} ✨ Delete prompt version #
PATCH /api/prompts/{prompt_id}/versions/{version_id} ✨ Update prompt version #
GET /api/prompts/{prompt_id}/versions/{version_id}/cost-estimate ✨ Get cost estimate for running a prompt version on a particular project/subset #
GET /api/prompts/{prompt_id}/versions/{version_id}/refine ✨ Get refined prompt #
POST /api/prompts/{prompt_id}/versions/{version_id}/refine ✨ Refine a prompt version #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/label-studio-subpackage-prompts-subpackage-prompts-versions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

label-studio-subpackage-prompts-subpackage-prompts-versions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Reference Subpackage Prompts.subpackage Prompts/versions API
  version: 1.0.0
servers:
- url: http://localhost:8000
tags:
- name: subpackage_prompts.subpackage_prompts/versions
paths:
  /api/prompts/{id}/get-default-version-name:
    get:
      operationId: get-default-version-name
      summary: ✨ Get default prompt version name
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Get default prompt version name'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: No response body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/prompts_versions_get_default_version_name_Response_200'
  /api/prompts/{prompt_id}/versions:
    get:
      operationId: list
      summary: ✨ List prompt versions
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        List all versions of a prompt.'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        schema:
          type: string
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ThirdPartyModelVersion'
    post:
      operationId: create
      summary: ✨ Create prompt version
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Create a new version of a prompt.'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThirdPartyModelVersion'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThirdPartyModelVersionRequest'
  /api/prompts/{prompt_id}/versions/{version_id}:
    get:
      operationId: get
      summary: ✨ Get prompt version
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Retrieve a specific prompt of a model.'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: version_id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThirdPartyModelVersion'
    delete:
      operationId: delete
      summary: ✨ Delete prompt version
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Delete a prompt version by ID'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: version_id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
    patch:
      operationId: update
      summary: ✨ Update prompt version
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Update a specific prompt version by ID.'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: version_id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThirdPartyModelVersion'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedThirdPartyModelVersionRequest'
  /api/prompts/{prompt_id}/versions/{version_id}/cost-estimate:
    get:
      operationId: cost-estimate
      summary: ✨ Get cost estimate for running a prompt version on a particular project/subset
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Get an estimate of the cost for making an inference run on the selected Prompt Version and Project/ProjectSubset'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: version_id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Cost estimate response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferenceRunCostEstimate'
  /api/prompts/{prompt_id}/versions/{version_id}/refine:
    get:
      operationId: get-refined-prompt
      summary: ✨ Get refined prompt
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Get the refined prompt based on the `refinement_job_id`.'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: version_id
        in: path
        required: true
        schema:
          type: integer
      - name: refinement_job_id
        in: query
        description: Refinement Job ID acquired from the `POST /api/prompts/{prompt_id}/versions/{version_id}/refine` endpoint
        required: false
        schema:
          type: string
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Refined prompt response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefinedPromptResponse'
    post:
      operationId: refine-prompt
      summary: ✨ Refine a prompt version
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Refine a prompt version using a teacher model and save the refined prompt as a new version.'
      tags:
      - subpackage_prompts.subpackage_prompts/versions
      parameters:
      - name: prompt_id
        in: path
        required: true
        schema:
          type: integer
      - name: version_id
        in: path
        required: true
        schema:
          type: integer
      - name: async
        in: query
        description: Whether to run the refinement asynchronously
        required: false
        schema:
          type: boolean
      - name: Authorization
        in: header
        description: '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>'
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Refined prompt response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefinedPromptResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefinePromptRequestRequest'
components:
  schemas:
    ThirdPartyModelVersionRequest:
      type: object
      properties:
        max_few_shot_examples:
          type:
          - integer
          - 'null'
          description: Max number of few-shot examples to include in prompts. 0 = disabled.
        model_provider_connection:
          type:
          - integer
          - 'null'
        organization:
          type:
          - integer
          - 'null'
        parent_model:
          type: integer
          description: Parent model interface ID
        prompt:
          type: string
          description: Prompt to execute
        provider:
          $ref: '#/components/schemas/ProviderEnum'
          description: 'The model provider to use e.g. OpenAI


            * `OpenAI` - OpenAI

            * `AzureOpenAI` - AzureOpenAI

            * `AzureAIFoundry` - AzureAIFoundry

            * `VertexAI` - VertexAI

            * `Gemini` - Gemini

            * `Anthropic` - Anthropic

            * `Custom` - Custom'
        provider_model_id:
          type: string
          description: The model ID to use within the given provider, e.g. gpt-3.5
        title:
          type: string
          description: Model name
      required:
      - prompt
      - provider_model_id
      - title
      title: ThirdPartyModelVersionRequest
    prompts_versions_get_default_version_name_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: prompts_versions_get_default_version_name_Response_200
    PatchedThirdPartyModelVersionRequest:
      type: object
      properties:
        max_few_shot_examples:
          type:
          - integer
          - 'null'
          description: Max number of few-shot examples to include in prompts. 0 = disabled.
        model_provider_connection:
          type:
          - integer
          - 'null'
        organization:
          type:
          - integer
          - 'null'
        parent_model:
          type: integer
          description: Parent model interface ID
        prompt:
          type: string
          description: Prompt to execute
        provider:
          $ref: '#/components/schemas/ProviderEnum'
          description: 'The model provider to use e.g. OpenAI


            * `OpenAI` - OpenAI

            * `AzureOpenAI` - AzureOpenAI

            * `AzureAIFoundry` - AzureAIFoundry

            * `VertexAI` - VertexAI

            * `Gemini` - Gemini

            * `Anthropic` - Anthropic

            * `Custom` - Custom'
        provider_model_id:
          type: string
          description: The model ID to use within the given provider, e.g. gpt-3.5
        title:
          type: string
          description: Model name
      title: PatchedThirdPartyModelVersionRequest
    InferenceRunCostEstimate:
      type: object
      properties:
        completion_cost_usd:
          type:
          - string
          - 'null'
          description: Cost of the completion (in USD)
        error_message:
          type:
          - string
          - 'null'
          description: Error message details
        error_type:
          type:
          - string
          - 'null'
          description: Type of error (e.g. "Timeout", "Rate Limit", etc)
        is_error:
          type:
          - boolean
          - 'null'
          description: Whether an error occurred or not
        prompt_cost_usd:
          type:
          - string
          - 'null'
          description: Cost of the prompt (in USD)
        total_cost_usd:
          type:
          - string
          - 'null'
          description: Total cost of the inference (in USD)
      title: InferenceRunCostEstimate
    UserSimple:
      type: object
      properties:
        avatar:
          type: string
        email:
          type: string
          format: email
        first_name:
          type: string
        id:
          type: integer
        last_name:
          type: string
        username:
          type: string
      required:
      - avatar
      - id
      - username
      description: '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'
      title: UserSimple
    RefinePromptRequestRequest:
      type: object
      properties:
        project_id:
          type: integer
          description: Project ID to target the refined prompt for
        teacher_model_name:
          type: string
          description: Name of the model to use to refine the prompt
        teacher_model_provider_connection_id:
          type: integer
          description: Model Provider Connection ID to use to refine the prompt
      required:
      - project_id
      - teacher_model_name
      - teacher_model_provider_connection_id
      title: RefinePromptRequestRequest
    ThirdPartyModelVersion:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        created_by:
          $ref: '#/components/schemas/UserSimple'
          description: User who created Dataset
        id:
          type: integer
        max_few_shot_examples:
          type:
          - integer
          - 'null'
          description: Max number of few-shot examples to include in prompts. 0 = disabled.
        model_display_name:
          type: string
        model_provider_connection:
          type:
          - integer
          - 'null'
        organization:
          type:
          - integer
          - 'null'
        parent_model:
          type: integer
          description: Parent model interface ID
        prompt:
          type: string
          description: Prompt to execute
        provider:
          $ref: '#/components/schemas/ProviderEnum'
          description: 'The model provider to use e.g. OpenAI


            * `OpenAI` - OpenAI

            * `AzureOpenAI` - AzureOpenAI

            * `AzureAIFoundry` - AzureAIFoundry

            * `VertexAI` - VertexAI

            * `Gemini` - Gemini

            * `Anthropic` - Anthropic

            * `Custom` - Custom'
        provider_model_id:
          type: string
          description: The model ID to use within the given provider, e.g. gpt-3.5
        score:
          type: string
        title:
          type: string
          description: Model name
        updated_at:
          type: string
          format: date-time
      required:
      - created_at
      - created_by
      - id
      - model_display_name
      - prompt
      - provider_model_id
      - score
      - title
      - updated_at
      title: ThirdPartyModelVersion
    ProviderEnum:
      type: string
      enum:
      - OpenAI
      - AzureOpenAI
      - AzureAIFoundry
      - VertexAI
      - Gemini
      - Anthropic
      - Custom
      description: '* `OpenAI` - OpenAI

        * `AzureOpenAI` - AzureOpenAI

        * `AzureAIFoundry` - AzureAIFoundry

        * `VertexAI` - VertexAI

        * `Gemini` - Gemini

        * `Anthropic` - Anthropic

        * `Custom` - Custom'
      title: ProviderEnum
    RefinedPromptResponse:
      type: object
      properties:
        previous_version:
          oneOf:
          - $ref: '#/components/schemas/ThirdPartyModelVersion'
          - type: 'null'
          description: Previous version of the prompt
        prompt:
          type: string
          description: The refined prompt text
        reasoning:
          type:
          - string
          - 'null'
          description: Reasoning behind the refinement
        refinement_job_id:
          type:
          - string
          - 'null'
          description: Unique identifier for the refinement job
        refinement_status:
          type:
          - string
          - 'null'
          description: Status of the refinement job
        title:
          type:
          - string
          - 'null'
          description: Title of the refined prompt
        total_cost:
          type:
          - string
          - 'null'
          description: Total cost of the refinement job (in USD)
      required:
      - previous_version
      - prompt
      - reasoning
      - refinement_job_id
      - refinement_status
      - title
      - total_cost
      title: RefinedPromptResponse
  securitySchemes:
    Token:
      type: apiKey
      in: header
      name: Authorization
      description: '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>'