Creating a prompt
- Go to Prompts → New Prompt (or use the
/prompts/newroute) - Pick a model (provider/model format)
- Write your system prompt and user message template
- Define variables (placeholders like
{{topic}}that get filled at runtime) - Optionally configure: structured output schema, fallback chain, temperature, max tokens
Variables
Variables are{{double_braced}} placeholders in your prompt template. Define them in the prompt editor with a name, type, and description:
string, number, boolean. Required variables must be passed at runtime — the gateway returns a 400 if any are missing.
See Prompt Engineering for details on variables, partials, and fallback chains.
Running a prompt
promptId field tags the request for log correlation — the prompt’s template content is not used. To execute a prompt’s actual template with variable interpolation, use POST /v1/prompts/{slug}/run.
Versioning
Each edit creates a new draft. When you’re ready:- Click Publish — creates a new version
- The published version is cached by the gateway (60s TTL)
- Existing API calls continue to use the previously published version until the cache expires
A/B testing
Enable A/B testing on a prompt to split traffic between the published version and a variant:- Create a new version with your changes
- Enable A/B testing with a split ratio (e.g., 50/50)
- The gateway randomly picks which version to serve per request
- Compare results in the Eval tab
Evals and scenarios
Define test scenarios with expected inputs and assertions, then run evals to compare prompt versions. See the Eval tab inside each prompt for the full workflow.Output schema
Attach a JSON schema to a prompt to enforce structured output. The gateway translates the schema to the provider’s native format automatically. Define the schema in the prompt editor using the visual schema builder or raw JSON.Fallback chains
Configure fallback models per prompt. If the primary model returns a rate limit, provider error, timeout, or context limit, the gateway tries the next model in the chain:triggers array, the fallback fires on any error — useful as a last-resort catch-all.
