POST
/
rest
/
track-prompt

Associate a prompt template with a request.

Example Code

import requests
response = requests.post(
  "https://api.promptlayer.com/rest/track-prompt",
  json={
      "api_key": "<YOUR_API_KEY>",
      "prompt_name": "<PROMPT_NAME>",
      "prompt_input_variables": {"variable1": "value1", "variable2": "value2"},
      "request_id": "<REQUEST_ID>",
      "version": "<VERSION>"
  },
)

Body

application/json
api_key
string
required

Your PromptLayer API Key.

Minimum length: 1
prompt_name
string
required

The name of the prompt template.

Minimum length: 1
request_id
integer
required

The unique identifier for the request.

label
string

The label of the prompt template version. Both version and label cannot be specified. Only one or none.

Required string length: 1 - 512
prompt_input_variables
object

Input variables for the prompt template.

version
integer

The version of the prompt template. Both version and label cannot be specified. Only one or none.

Response

200 - application/json
message
string
required
success
boolean
required