Skip to main content
GET
/
api
/
prompts
/
{id}
Python
import requests

url = "https://app.langwatch.ai/api/prompts/{id}"

headers = {"X-Auth-Token": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
{
  "id": "<string>",
  "handle": "<string>",
  "scope": "ORGANIZATION",
  "name": "<string>",
  "updatedAt": "<string>",
  "projectId": "<string>",
  "organizationId": "<string>",
  "versionId": "<string>",
  "version": 123,
  "createdAt": "<string>",
  "prompt": "<string>",
  "messages": [],
  "inputs": [],
  "outputs": [
    {
      "identifier": "<string>",
      "type": "str",
      "json_schema": {
        "type": "<string>"
      }
    }
  ],
  "model": "<string>",
  "tags": [],
  "authorId": "<string>",
  "commitMessage": "<string>",
  "temperature": 123,
  "maxTokens": 123,
  "demonstrations": {
    "id": "<string>",
    "name": "<string>",
    "inline": {
      "records": {},
      "columnTypes": [
        {
          "name": "<string>",
          "type": "<string>",
          "id": "<string>"
        }
      ]
    }
  },
  "promptingTechnique": {
    "type": "few_shot",
    "demonstrations": {
      "id": "<string>",
      "name": "<string>",
      "inline": {
        "records": {},
        "columnTypes": [
          {
            "name": "<string>",
            "type": "<string>",
            "id": "<string>"
          }
        ]
      }
    }
  },
  "responseFormat": {
    "type": "json_schema",
    "json_schema": {
      "name": "<string>",
      "schema": {}
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://langwatch.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-Auth-Token
string
header
required

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Path Parameters

id
string
required

Prompt slug or shorthand. Supports three formats: (1) bare slug — "pizza-prompt" returns the latest version; (2) slug:tag — "pizza-prompt:production" returns the version pointed to by that tag; (3) slug:version — "pizza-prompt:2" returns that specific version number. "slug:latest" is equivalent to the bare slug. Cannot be combined with the tag or version query parameters.

Query Parameters

version
integer

Specific version number to retrieve. Cannot be used when the id path already contains a shorthand suffix.

Required range: x >= 0
tag
string

Fetch the version pointed to by this tag (e.g., "production", "staging"). Cannot be used when the id path already contains a shorthand suffix.

Response

Success

id
string
required
handle
string | null
required
scope
enum<string>
required
Available options:
ORGANIZATION,
PROJECT
name
string
required
updatedAt
string
required
projectId
string
required
organizationId
string
required
versionId
string
required
version
number
required
createdAt
string
required
prompt
string
required
messages
object[]
required
inputs
object[]
required
outputs
object[]
required
Minimum array length: 1
model
string
required
Minimum string length: 1
tags
object[]
required
authorId
string | null
commitMessage
string | null
temperature
number
maxTokens
number
demonstrations
object
promptingTechnique
object
responseFormat
object