Reference
Get All Prompt Templates
Languages & Environments
Usage Documentation
- Sharing Requests
- Prompt Registry
- Running Requests
- Advanced Logging
- FAQ
Why PromptLayer?
Reference
- REST API Reference
- POSTGet Prompt Template
- POSTPublish Prompt Template
- GETGet Prompt Template Labels
- PATCHMove Prompt Template Labels
- DELDelete a Prompt Template Label
- POSTCreate a Prompt Template Label
- POSTTrack Score
- POSTTrack Prompt
- POSTTrack Group
- POSTTrack Metadata
- GETGet All Prompt Templates
- POSTCreate Dataset from History
- POSTCreate Evaluation Pipeline
- DELDelete Reports by Name
- POSTLog Request
- GETGet Agent Version Execution Results
- POSTRun Agent
Reference
Get All Prompt Templates
GET
/
prompt-templates
curl --request GET \
--url https://api.promptlayer.com/prompt-templates \
--header 'X-API-KEY: <x-api-key>'
{
"has_next": true,
"has_prev": true,
"items": [
{
"id": 123,
"prompt_name": "<string>",
"prompt_template": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"metadata": {
"model": {
"provider": "<string>",
"name": "<string>",
"parameters": {}
},
"customField": "<string>"
},
"commit_message": "<string>",
"llm_kwargs": {},
"version": 123
}
],
"next_num": 123,
"prev_num": 123,
"page": 123,
"pages": 123,
"total": 123
}
Get a list of all prompt templates.
Headers
Response
200 - application/json
Successful Response
Available options:
f-string
, jinja2
Available options:
completion
When you optionally specify provider
in the body, llm_kwargs
will be returned for that specific provider and you can pass these kwargs to the provider's API directly.
Was this page helpful?
curl --request GET \
--url https://api.promptlayer.com/prompt-templates \
--header 'X-API-KEY: <x-api-key>'
{
"has_next": true,
"has_prev": true,
"items": [
{
"id": 123,
"prompt_name": "<string>",
"prompt_template": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"metadata": {
"model": {
"provider": "<string>",
"name": "<string>",
"parameters": {}
},
"customField": "<string>"
},
"commit_message": "<string>",
"llm_kwargs": {},
"version": 123
}
],
"next_num": 123,
"prev_num": 123,
"page": 123,
"pages": 123,
"total": 123
}