POST
/
prompts
/
{promptId}
/
completions

Portkey Prompts API completely for both requests and responses, making it a drop-in replacement existing for your existing Chat or Completions calls.

Features

Authorizations

x-portkey-api-key
string
headerrequired

Path Parameters

promptId
string
required

The unique identifier of the prompt template to use

Body

application/json

Note: Although hyperparameters are shown grouped here (like messages, max_tokens, temperature, etc.), they should only be passed at the root level, alongside 'variables' and 'stream'.

variables
object
required

Variables to substitute in the prompt template

stream
boolean
default: false

Default: False. Set to True if you want to stream the response

hyperparameters
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
status
string

Response status

headers
object

Response headers

body
object

Represents a chat completion response returned by model, based on the provided input.