v18

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-2112360218.7 KB
Prompt Versions

Diff Prompt Versions

Compares the templates of two prompt versions side-by-side and returns a unified diff. Requires read access to the prompt.

get/v1/prompts/{id}/versions/diff

Path parameters

idstring uuid required

Query parameters

fromstring required

The source version number (integer) or version tag (string) to compare from.

tostring required

The target version number (integer) or version tag (string) to compare to.

Response

Versions compared successfully

from_versioninteger required
to_versioninteger required
from_templatestring required
to_templatestring required
diffstring required

Example response

{
  "from_version": 1,
  "to_version": 2,
  "from_template": "Hello {{ .name }}",
  "to_template": "Hello {{ .name }}!\nWelcome to px0.",
  "diff": "--- v1\n+++ v2\n@@ -1 +1,2 @@\n-Hello {{ .name }}\n+Hello {{ .name }}!\n+Welcome to px0.\n"
}