Prompts

Retrieve prompt version

Changed on

Retrieve prompt version. When project_name is supplied the lookup is scoped to that project: a prompt belonging to a different project is never matched, and an unknown project name returns 404. Legacy prompts with no project are still resolved as a deprecated fallback, signalled by the X-Opik-Deprecation response header.

post/v1/private/prompts/versions/retrieve

Request

  • Base URL
    http://localhost:5173/api
  • URL
    http://localhost:5173/api/v1/private/prompts/versions/retrieve
  • Auth
    none declared

Request body

namestring required
commitstring
environmentstring

If provided, resolves to the version mapped to this environment for the prompt; mutually exclusive with commit and version_number

version_numberstring

If provided, resolves to the version with this sequential number (e.g. v3); mutually exclusive with commit and environment

project_namestring

If provided, scopes the search to the specified project; prompts belonging to other projects are never matched, and an unknown project name returns 404. Legacy prompts that are not scoped to any project are still matched as a deprecated fallback, signalled by the X-Opik-Deprecation response header.

Response

OK

idstring uuid

version unique identifier, generated if absent

prompt_idstring uuid
commitstring

version short unique identifier, generated if absent. it must be 8 characters long

version_numberstring

sequential version number in the format v<N>; null for masks

templatestring required
metadataJsonNodeDetail
type'mustache' | 'jinja2' | 'python'
version_type'prompt_version' | 'mask'

version type discriminator; defaults to prompt_version

environmentstring

Deprecated: use 'environments' instead

environmentsstring[]
change_descriptionstring
tagsstring[]
variablesstring[]
template_structure'text' | 'chat'
created_atstring date-time
created_bystring

Changes

    • info

      added the optional property to the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the optional property to the response with the status