Getting started

Quickstart

Prompt Engine keeps your prompts out of your codebase. You call one endpoint, we return whichever version is live, and changing which version is live is a click in the dashboard — no deploy, no code change.

1

Create an engine

An engine is one slot in your product that needs a prompt — a support reply, a summarizer, a classifier. Create one from Engines, then write a prompt in it and hit activate.

Note the engine's ID, shown on its page. That number goes in the URL you're about to call.

2

Generate an API key

Go to API Key and generate one. New accounts start without a key on purpose.

The key is shown once and cannot be retrieved afterwards — put it in your secret manager now, not later.
3

Make the call

Swap in your engine ID and export your key as PROMPT_ENGINE_KEY.

curl -X POST \
  https://api.promptengine.co.in/v1/engines/12/active-prompt \
  -H "Authorization: Bearer $PROMPT_ENGINE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "variables": { "product": "Acme Cloud", "ticket_body": "..." } }'
4

Read the response

json
{
  "success": true,
  "data": {
    "version": "1.0",
    "mode": "text",
    "messages": [
      {
        "role": "system",
        "content": "You are a support analyst for Acme Cloud.\n\nBe factual and concise.\nNever invent details that are not in the ticket."
      },
      {
        "role": "user",
        "content": "Summarize the following support ticket in 3 bullets:\n\nCannot log in since Tuesday."
      }
    ],
    "text": "You are a support analyst for Acme Cloud.\n\nBe factual and concise.\nNever invent details that are not in the ticket.\n\nSummarize the following support ticket in 3 bullets:\n\nCannot log in since Tuesday.",
    "missing_variables": []
  },
  "error": null
}

messages is the field you want — it's already in the shape every chat API takes:

js
const completion = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: data.messages,
});

It is always a system entry then a user entry, in that order. This prompt is a Kitchen one, so both carry content; a plain template returns the same two entries with the system one empty. The array never changes length, so those two lines above keep working whatever you build in the dashboard.

That's the whole integration

You never write those two lines again. Change the prompt in the dashboard, activate a new version, and the next call returns the new one — the response keeps the same shape even if you rebuild the prompt as a completely different kind.

Next: Concepts explains what engines, versions and activation actually mean — worth ten minutes before you build on this.