GET
/
rest
/
get-prompt-template
curl --request GET \
  --url https://api.promptlayer.com/rest/get-prompt-template \
  --header 'X-API-KEY: <x-api-key>'
{
  "id": 123,
  "version": 123,
  "prompt_name": "<string>",
  "prompt_template": {
    "input_variables": [
      "<string>"
    ],
    "messages": [
      {
        "prompt": {
          "input_variables": [
            "<string>"
          ],
          "template": "<string>",
          "template_format": "<string>",
          "validate_template": true
        },
        "additional_kwargs": {},
        "role": "<string>"
      }
    ],
    "functions": [
      {
        "name": "<string>",
        "description": "<string>",
        "parameters": {}
      }
    ],
    "function_call": "none"
  },
  "tags": [
    "<string>"
  ],
  "commit_message": "<string>",
  "metadata": {
    "model": {
      "provider": "<string>",
      "name": "<string>",
      "parameters": {}
    },
    "customField": "<string>"
  }
}

Get Prompt Template allows you to get the template for a prompt based on the name. If the template is found, it will send you back a json object that includes some metadata (including the id, which can be used as the prompt_id in track-request) and the prompt-template itself which is a JSON representation of your prompt following the langchain format.

Headers

X-API-KEY
string
required

Query Parameters

prompt_name
string
required
version
integer
label
string

Response

200 - application/json
id
integer
required

The id of the prompt

version
integer

The version of the prompt

prompt_name
string
required

Prompt name has to be less than 128 characters and can only contain letters, numbers, and underscores. If a prompt exists with this name it will be pushed into an older version

prompt_template
object
required

Chat Prompt Template

tags
string[]

Array of string tags for a template

commit_message
string

Commit message for the prompt version

metadata
object