Skip to main content
POST
Given a prompt ID, variable values, and optionally any hyperparameters, this API returns a JSON object containing the raw prompt template.
Note: Unlike inference requests, Prompt Render API calls are processed through Portkey’s Control Plane services.
Here’s how you can take the output from the render API and use it for making a separate LLM call. We’ll take example of OpenAI SDKs, but you can use it simlarly for any other frameworks like Langchain etc. as well.

Authorizations

x-portkey-api-key
string
header
required

Path Parameters

promptId
string
required

The unique identifier of the prompt template to render

Body

application/json

Note: Although hyperparameters are shown grouped here (like messages, max_completion_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'. The max_tokens parameter is deprecated — use max_completion_tokens instead.

variables
object
required

Variables to substitute in the prompt template

hyperparameters
Chat Completions · object

Note: All hyperparameters are optional. Pass them at the root level, and not nested under hyperparameters. Their grouping here is for educational purposes only.

Response

200 - application/json

Successful rendered prompt

success
boolean
required

Indicates if the render was successful

data
Chat Completions · object
required
Last modified on April 8, 2026