GET
/
rest
/
prompts
curl --request GET \
  --url https://api.promptlayer.com/rest/prompts \
  --header 'X-API-KEY: <x-api-key>'
{
  "page": 1,
  "per_page": 30,
  "total": 123,
  "pages": 123,
  "items": [
    {
      "id": 123,
      "version_number": 123,
      "prompt_name": "<string>",
      "prompt_template": {
        "input_variables": [
          "<string>"
        ],
        "messages": [
          {
            "prompt": {
              "input_variables": [
                "<string>"
              ],
              "template": "<string>",
              "template_format": "f-string",
              "validate_template": true
            },
            "additional_kwargs": {},
            "role": "<string>"
          }
        ],
        "functions": [
          {
            "name": "<string>",
            "description": "",
            "parameters": {
              "type": "object",
              "properties": {}
            }
          }
        ],
        "function_call": "none"
      },
      "tags": [],
      "commit_message": "<string>",
      "metadata": {
        "model": {
          "provider": "<string>",
          "name": "<string>",
          "parameters": {}
        },
        "customField": "<string>"
      }
    }
  ]
}

Get a list of all prompt templates.

Headers

X-API-KEY
string
required

Query Parameters

page
integer
per_page
integer

Response

200
application/json

Successful Response

The response is of type object.