Reference
Publish Prompt Template
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
Publish Prompt Template
POST
/
rest
/
prompt-templates
curl --request POST \
--url https://api.promptlayer.com/rest/prompt-templates \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"prompt_template": {
"prompt_name": "<string>",
"tags": []
},
"prompt_version": {
"prompt_template": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"commit_message": "<string>",
"metadata": {
"model": {
"provider": "<string>",
"name": "<string>",
"parameters": {}
},
"customField": "<string>"
}
},
"release_labels": [
"<string>"
]
}'
{
"id": 123,
"prompt_name": "<string>",
"tags": [
"<string>"
],
"release_labels": [
"<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>"
}
Publish Prompt Template allows you to programmatically create a new version of a prompt template and make it available for use in the application.
Headers
Body
application/json
Available options:
f-string
, jinja2
Available options:
completion
Maximum length:
72
Response
200
application/json
Successful Response
Available options:
f-string
, jinja2
Available options:
completion
Was this page helpful?
curl --request POST \
--url https://api.promptlayer.com/rest/prompt-templates \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"prompt_template": {
"prompt_name": "<string>",
"tags": []
},
"prompt_version": {
"prompt_template": {
"content": [
{
"type": "text",
"text": "<string>"
}
],
"input_variables": [],
"template_format": "f-string",
"type": "completion"
},
"commit_message": "<string>",
"metadata": {
"model": {
"provider": "<string>",
"name": "<string>",
"parameters": {}
},
"customField": "<string>"
}
},
"release_labels": [
"<string>"
]
}'
{
"id": 123,
"prompt_name": "<string>",
"tags": [
"<string>"
],
"release_labels": [
"<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>"
}