For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • Python SDK
    • Reference
    • REST API Client
  • Typescript SDK
    • Overview
    • Opik TS
    • Prompts
    • Opik Query Language (OQL)
  • Rest API
    • Overview
        • GETGet prompts
        • POSTCreate prompt
        • POSTCreate prompt version
        • PATCHUpdate prompt versions
        • GETGet prompt by id
        • PUTUpdate prompt
        • DELDelete prompt
        • POSTDelete prompts
        • GETGet prompt by commit
        • GETGet prompt version by id
        • GETGet prompt version by sequential number
        • GETGet prompt versions
        • POSTGet prompts by commits
        • POSTRestore prompt version
        • POSTRetrieve prompt version
        • POSTRetrieve prompt versions by ids
        • PATCHSet prompt version environment
LogoLogo
Copy to LLMGithubGo to App
Rest APIAPI ReferencePrompts

Get prompt version by sequential number

GET
/v1/private/prompts/:promptId/versions/by-number/:versionNumber
GET
/api/v1/private/prompts/:promptId/versions/by-number/:versionNumber
$curl http://localhost:5173/api/v1/private/prompts/promptId/versions/by-number/versionNumber
1{
2 "template": "string",
3 "id": "string",
4 "prompt_id": "string",
5 "commit": "string",
6 "version_number": "string",
7 "metadata": {},
8 "type": "mustache",
9 "version_type": "prompt_version",
10 "environments": [
11 "string"
12 ],
13 "change_description": "string",
14 "tags": [
15 "string"
16 ],
17 "variables": [
18 "string"
19 ],
20 "template_structure": "text",
21 "created_at": "2024-01-15T09:30:00Z",
22 "created_by": "string",
23 "environment": "string"
24}

Get a prompt version by its sequential v<N> number for the given prompt.

Was this page helpful?
Previous

Get prompt versions

Next
Built with

Path parameters

promptIdstringRequiredformat: "uuid"
versionNumberstringRequiredformat: "v\d+"0-10 characters

Response

Prompt version resource
templatestring>=1 character
idstringformat: "uuid"
version unique identifier, generated if absent
prompt_idstringRead-onlyformat: "uuid"
commitstringformat: "^[a-zA-Z0-9]{8}$"
version short unique identifier, generated if absent. it must be 8 characters long
version_numberstringRead-only

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

metadataobject
typeenum
Allowed values:
version_typeenum

version type discriminator; defaults to prompt_version

Allowed values:
environmentslist of strings
change_descriptionstring
tagslist of strings
variableslist of stringsRead-only
template_structureenumRead-only
Allowed values:
created_atdatetimeRead-only
created_bystringRead-only
environmentstringformat: "^[A-Za-z0-9_-]+$"0-150 charactersDeprecated

Deprecated: use ‘environments’ instead

Errors

400
Bad Request Error
404
Not Found Error