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 by commit

GET
/v1/private/prompts/by-commit/:commit
GET
/api/v1/private/prompts/by-commit/:commit
$curl http://localhost:5173/api/v1/private/prompts/by-commit/commit
1{
2 "name": "string",
3 "id": "string",
4 "project_id": "string",
5 "description": "string",
6 "template_structure": "text",
7 "tags": [
8 "string"
9 ],
10 "created_at": "2024-01-15T09:30:00Z",
11 "created_by": "string",
12 "last_updated_at": "2024-01-15T09:30:00Z",
13 "last_updated_by": "string",
14 "version_count": 1,
15 "latest_version": {
16 "template": "string",
17 "id": "string",
18 "prompt_id": "string",
19 "commit": "string",
20 "version_number": "string",
21 "metadata": {},
22 "type": "mustache",
23 "version_type": "prompt_version",
24 "environments": [
25 "string"
26 ],
27 "change_description": "string",
28 "tags": [
29 "string"
30 ],
31 "variables": [
32 "string"
33 ],
34 "template_structure": "text",
35 "created_at": "2024-01-15T09:30:00Z",
36 "created_by": "string",
37 "environment": "string"
38 },
39 "requested_version": {
40 "template": "string",
41 "id": "string",
42 "prompt_id": "string",
43 "commit": "string",
44 "version_number": "string",
45 "metadata": {},
46 "type": "mustache",
47 "version_type": "prompt_version",
48 "environments": [
49 "string"
50 ],
51 "change_description": "string",
52 "tags": [
53 "string"
54 ],
55 "variables": [
56 "string"
57 ],
58 "template_structure": "text",
59 "created_at": "2024-01-15T09:30:00Z",
60 "created_by": "string",
61 "environment": "string"
62 }
63}
Get prompt by commit
Was this page helpful?
Previous

Get prompt version by id

Next
Built with

Path parameters

commitstringRequiredformat: "^[a-zA-Z0-9]{8}$"

Response

OK
namestring>=1 character
idstringformat: "uuid"
project_idstringformat: "uuid"

Project ID. Takes precedence over project_name when both are provided.

descriptionstringformat: "(?s)^\s*(\S.*\S|\S)\s*$"0-255 characters
template_structureenumDefaults to text

Template structure type: ‘text’ or ‘chat’. Immutable after creation.

Allowed values:
tagslist of strings
created_atdatetimeRead-only
created_bystringRead-only
last_updated_atdatetimeRead-only
last_updated_bystringRead-only
version_countlongRead-only
latest_versionobject
requested_versionobject

Errors

400
Bad Request Error
404
Not Found Error
409
Conflict Error