Retrieve prompt version

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.

Request

This endpoint expects an object.
namestringRequired>=1 character
commitstringOptional
environmentstringOptionalformat: "^[A-Za-z0-9_-]+$"0-150 characters

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

version_numberstringOptionalformat: "v\d+"0-10 characters

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

project_namestringOptionalformat: "(?s)^\s*(\S.*\S|\S)\s*$"

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 headers

X-Opik-DeprecationstringOptional

Present only when the prompt was resolved through the deprecated workspace-wide fallback, i.e. it has no project. Absent for project-scoped prompts.

Response

OK
templatestring>=1 character
idstringOptionalformat: "uuid"
version unique identifier, generated if absent
prompt_idstringOptionalRead-onlyformat: "uuid"
commitstringOptionalformat: "^[a-zA-Z0-9]{8}$"
version short unique identifier, generated if absent. it must be 8 characters long
version_numberstringOptionalRead-only

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

metadataobjectOptional
typeenumOptional
version_typeenumOptional

version type discriminator; defaults to prompt_version

environmentslist of stringsOptional
change_descriptionstringOptional
tagslist of stringsOptional
variableslist of stringsOptionalRead-only
template_structureenumOptionalRead-only
created_atdatetimeOptionalRead-only
created_bystringOptionalRead-only
environmentstringOptionalformat: "^[A-Za-z0-9_-]+$"0-150 charactersDeprecated

Deprecated: use ‘environments’ instead

Errors

400
Bad Request Error
404
Not Found Error
422
Unprocessable Entity Error