POST
/
prompts
curl --request POST \
  --url https://api.portkey.ai/v1/prompts \
  --header 'Content-Type: application/json' \
  --header 'x-portkey-api-key: <api-key>' \
  --data '{
  "name": "<string>",
  "collection_id": "<string>",
  "string": "<string>",
  "parameters": {},
  "functions": [
    "<any>"
  ],
  "tools": [
    "<any>"
  ],
  "tool_choice": {},
  "model": "<string>",
  "virtual_key": "<string>",
  "version_description": "<string>",
  "template_metadata": {}
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "slug": "<string>",
  "version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "object": "prompt"
}

Authorizations

x-portkey-api-key
string
header
required

Body

application/json
name
string
required
collection_id
string
required

UUID or slug of the collection

string
string
required

Prompt template in string format

parameters
object
required

Parameters for the prompt

functions
any[]

Functions for the prompt

tools
any[]

Tools for the prompt

tool_choice
object

Tool Choice for the prompt

model
string

The model to use for the prompt

virtual_key
string

The virtual key to use for the prompt

version_description
string

The description of the prompt version

template_metadata
object

Metadata for the prompt

Response

200
application/json
Prompt created successfully
id
string
slug
string
version_id
string
object
enum<string>
Available options:
prompt