Languages & Environments
Usage Documentation
- Tagging Requests
- Sharing Prompts
- Prompt Registry
- Advanced Logging
- FAQ
Why PromptLayer?
Reference
- REST API Reference
- POSTTrack Request
- POSTGet Prompt Template
- GETGet Prompt Template (Deprecated)
- POSTPublish Prompt Template
- POSTPublish Prompt Template (Deprecated)
- POSTTrack Score
- POSTTrack Prompt
- POSTTrack Group
- POSTTrack Metadata
- GETGet All Prompt Templates
- POSTCreate Dataset from History
- POSTCreate Evaluation Pipeline
Reference
Get All Prompt Templates
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
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
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>"
}
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.