POST
https://api.promptlayer.com
/
rest
/
track-prompt
curl --request POST \
  --url https://api.promptlayer.com/rest/track-prompt \
  --header 'Content-Type: application/json' \
  --data '{
  "api_key": "<string>",
  "prompt_name": "<string>",
  "prompt_input_variables": {},
  "request_id": 123,
  "version": 123,
  "label": "<string>"
}'
{
  "success": true,
  "message": "<string>"
}

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

Response

200
application/json

Prompt tracked successfully

The response is of type object.