POST
/
rest
/
prompt-templates
curl --request POST \
  --url https://api.promptlayer.com/rest/prompt-templates \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '{
  "prompt_template": {
    "prompt_name": "<string>",
    "tags": [
      "<string>"
    ]
  },
  "prompt_version": {
    "prompt_template": {
      "content": [
        {
          "type": "<any>",
          "text": "<string>"
        }
      ],
      "input_variables": [
        "<string>"
      ],
      "template_format": "f-string",
      "type": "<any>"
    },
    "commit_message": "<string>",
    "metadata": {
      "model": {
        "provider": "<string>",
        "name": "<string>",
        "parameters": {}
      },
      "customField": "<string>"
    }
  },
  "release_labels": [
    "<string>"
  ]
}'
{
  "id": 123,
  "prompt_name": "<string>",
  "tags": [
    "<string>"
  ],
  "release_labels": [
    "<string>"
  ],
  "prompt_template": {
    "content": [
      {
        "type": "<any>",
        "text": "<string>"
      }
    ],
    "input_variables": [
      "<string>"
    ],
    "template_format": "f-string",
    "type": "<any>"
  },
  "metadata": {
    "model": {
      "provider": "<string>",
      "name": "<string>",
      "parameters": {}
    },
    "customField": "<string>"
  },
  "commit_message": "<string>"
}

Publish Prompt Template allows you to programmatically create a new version of a prompt template and make it available for use in the application.

Headers

X-API-KEY
string
required

Body

application/json
prompt_template
object
required
prompt_version
object
required
release_labels
string[] | null

Response

200 - application/json
id
integer
required
prompt_name
string
required
tags
string[]
required
release_labels
string[] | null
prompt_template
object
required

Completion Prompt Template

metadata
object | null
commit_message
string | null