Skip to main content
GET
/
prompt-templates
/
{identifier}
Get Prompt Template Raw Data
curl --request GET \
  --url https://api.promptlayer.com/prompt-templates/{identifier} \
  --header 'X-API-KEY: <api-key>'
{
  "success": true,
  "id": 17,
  "prompt_name": "support-response",
  "version": 2,
  "workspace_id": 42,
  "prompt_template": {
    "type": "chat",
    "messages": [
      {
        "role": "system",
        "content": [
          {
            "type": "text",
            "text": "You are a helpful support assistant."
          }
        ]
      },
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "{user_message}"
          }
        ]
      }
    ]
  },
  "metadata": {
    "model": {
      "provider": "openai",
      "name": "gpt-4o",
      "parameters": {
        "temperature": 0.2
      }
    }
  },
  "commit_message": "Improve support tone",
  "tags": [
    "support"
  ],
  "created_at": "2025-03-15T10:30:00Z",
  "snippets": [],
  "llm_kwargs": null
}

Documentation Index

Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt

Use this file to discover all available pages before exploring further.

Retrieve raw prompt template data without applying input variables. This endpoint is useful for template inspection, local caching, and GitHub sync workflows.

Behavior Notes

  • resolve_snippets=false returns raw @@@snippet@@@ references instead of expanded snippet content.
  • include_llm_kwargs=true includes provider-specific LLM API arguments for local execution or caching.
  • To bypass the default cache, send Cache-Control: no-cache.
  • The llm_kwargs shape is provider-specific and may change as provider APIs change; use prompt_template for stable, provider-agnostic data.

Authorizations

X-API-KEY
string
header
required

Path Parameters

identifier
string
required

The identifier can be either the prompt name or the prompt id.

Query Parameters

version
integer

Specific version number to retrieve. Mutually exclusive with label.

label
string

Release label name to retrieve (e.g. 'prod', 'staging'). Mutually exclusive with version.

resolve_snippets
boolean
default:true

When true (default), snippets are expanded in the returned prompt_template. When false, raw @@@snippet@@@ references are preserved.

include_llm_kwargs
boolean
default:false

When true, includes provider-specific llm_kwargs in the response. Requires model metadata to be set on the template.

Response

Successful Response

success
boolean
required
id
integer
required

The prompt template ID.

prompt_name
string
required

The name of the prompt template.

version
integer
required

The version number of the prompt template.

workspace_id
integer
required

The workspace this prompt template belongs to.

prompt_template
Completion Template · object
required

The prompt template content. When resolve_snippets is true (default), snippets are expanded. When false, raw @@@snippet@@@ references are preserved.

snippets
SnippetReference · object[]
required

List of snippet references used in this template.

metadata
Metadata · object

Model configuration including provider, model name, and parameters.

commit_message
string | null

The commit message for this version.

tags
string[]

Tags associated with the prompt template.

created_at
string<date-time> | null

Timestamp when this version was created.

llm_kwargs
LLM Kwargs · object

Provider-specific LLM arguments. Only present when include_llm_kwargs=true. Structure is provider-specific and may change without notice.