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.

prompt_name
string
required

The name of the prompt template.

prompt_input_variables
object

Input variables for the prompt template.

request_id
integer
required

The unique identifier for the request.

version
integer

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

label
string

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

Response

200 - application/json
success
boolean
required
message
string
required