GuidesGateway Features

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:

  1. Fetches the prompt template from the CoreValue API
  2. Resolves the correct version (by environment + version_id)
  3. Merges the template with your request messages
  4. Substitutes template variables from your request

Parameters

ParameterHeader/BodyRequiredDescription
prompt_idCova-Prompt-IdYesPrompt template identifier
version_idRequest bodyNoSpecific version to use
environmentRequest bodyNodev / staging / prod
inputsRequest bodyNoVariable 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.

On this page