Creating a prompt in the dashboard
Navigate to Prompts in the Gatelit dashboard and click New Prompt. Each prompt has:- System message — optional context set before the conversation
- User message template — the prompt template sent as the user turn
- Model — the default
provider/model-nameto use when running the prompt - Temperature and max tokens — default inference parameters
Variables
Use{{variable_name}} syntax anywhere in your system or user message templates to define dynamic placeholders. Variable names must start with a letter or underscore and contain only letters, digits, and underscores.
Prompt partials
Partials are reusable text blocks you can embed in any prompt template using{{> partial_name}} syntax:
{{variable}} references.
Publishing versions
Every change to a prompt creates a new version. To make a version active, click Publish on that version. The gateway always executes the published version of a prompt — unpublished draft versions are never run.Running a saved prompt via the API
Send aPOST request to /v1/prompts/:id/run with your prompt’s ID (visible in the dashboard) and any variable values:
Linking a request to a saved prompt
If you callclient.chat() directly (rather than the /v1/prompts/:id/run endpoint), you can link the request to a saved prompt for log correlation by passing promptId:
promptId are grouped under that prompt in the Gatelit dashboard logs, making it easy to track usage and cost per prompt.
Prompt versioning
Each time you save a prompt in the dashboard, a new version is created with an auto-incremented version number. Versions are immutable once created. To make changes, save a new version and then publish it. The gateway always runs the published version. If no version has been published yet, the/v1/prompts/:id/run endpoint returns a 404 error.
The gateway caches the published version of each prompt to minimize latency. After you publish a new version, the cache is automatically invalidated so the updated prompt takes effect immediately.
Fallback model chains
A prompt version can include a fallback model chain — an ordered list of alternative models to try if the primary model fails. Configure fallback chains on the version editor in the dashboard. Each entry in the chain specifies:- Model — the fallback model in
provider/model-nameformat - Triggers — which error conditions activate this fallback:
rate_limit— the provider returned a 429provider_error— the provider returned a 5xxtimeout— the upstream request timed outcontext_limit— the model’s context window was exceeded
The gateway tries each model in order, stopping at the first successful response. The
response.meta.model field tells you which model actually handled the request.