Prompt Expansion
Expand shorthand prompt templates server-side before forwarding to the upstream provider.
Prompt Expansion
Resolve prompt templates by ID at the gateway — keep prompt logic out of your application code.
Tier: Available on all tiers. Prompt templates are managed via the CoreValue API (the Prompts UI is deprecated, but the API and gateway expansion remain).
How It Works
Set the Cova-Prompt-Id header with a prompt template ID. The gateway:
- Fetches the prompt template from the CoreValue API
- Resolves the correct version (by environment + version_id)
- Merges the template with your request messages
- Substitutes template variables from your request
Parameters
| Parameter | Header/Body | Required | Description |
|---|---|---|---|
prompt_id | Cova-Prompt-Id | Yes | Prompt template identifier |
version_id | Request body | No | Specific version to use |
environment | Request body | No | dev / staging / prod |
inputs | Request body | No | Variable substitutions |
Usage
curl https://gateway.corevalue.dev/v1/chat/completions \
-H "Authorization: Bearer sk-cova-..." \
-H "Content-Type: application/json" \
-H "Cova-Prompt-Id: prompt_abc" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}],"inputs":{"name":"Alice"}}'import { buildHeaders } from "@cova/gateway";
const headers = buildHeaders({ promptId: "prompt_abc" });Org Scoping
Prompt templates are org-scoped. The gateway uses its API key to fetch templates via the CoreValue API, which enforces org-level access control. A prompt not belonging to your org returns 400.
Managing Prompts
The Prompts UI is deprecated (gated by COVA_FEATURE_PROMPTS_UI, default OFF). Manage prompts via the CoreValue API or SDK instead.
Related: Cova-* Headers Guide for all request headers.