Why Prompt Management?
Traditional prompt development involves hardcoded prompts in application code, messy string substitution, and frustrating and rebuilding deployments for every iteration. This creates friction that slows down experimentation and your team’s ability to ship.Iterate Without Code Changes
Test and deploy prompt changes instantly without rebuilding or redeploying your application
Version Control Built-In
Track every change, compare versions, and rollback instantly if something goes wrong
Dynamic Variables
Use variables anywhere - system prompts, messages, even tool schemas - for truly reusable prompts
Environment Management
Deploy different versions to production, staging, and development environments independently
Quickstart
1
Create a Prompt
Build a prompt in the Playground. Save any prompt with clear commit histories and tags.
2
Test and Iterate
Experiment with different variables, inputs, and models until you reach desired output. Variables can be used anywhere, even in tool schemas.
3
Run Prompt with AI Gateway
Use your prompt instantly by referencing its ID in your AI Gateway. No code changes, no rebuilds.
Your prompt is automatically compiled with the provided inputs and sent to your chosen model. Update prompts in the dashboard and changes take effect immediately!
Prompt Assembly Process
When you make an LLM call with a prompt ID, the AI Gateway will compile your saved prompt alongside runtime parameters you provide.Version Selection
The AI Gateway automatically determines which prompt version to use based on the parameters you provide:Uses the version deployed to that environment (e.g., production, staging, development)
Uses a specific version directly by its ID
Default behavior: If neither parameter is provided, the production version is used. Environment takes precedence over version_id if both are specified.
Parameter Priority
Saved prompts store all the configuration you set in the playground - temperature, max tokens, response format, system messages, and more. At runtime, these saved parameters are used as defaults, but any parameters you specify in your API call will override them.Message Handling
Messages work differently than other parameters. Instead of overriding, runtime messages are appended to the saved prompt messages. This allows you to:- Define consistent system prompts and example conversations in your saved prompt
- Add dynamic user messages at runtime
- Build multi-turn conversations that maintain context
messages
parameter becomes optional in API calls when using Helicone prompts. However, if your prompt template is empty or lacks messages, you’ll need to provide them at runtime.
Runtime messages are always appended to the end of your saved prompt messages. Make sure your saved prompt structure accounts for this behavior.
Override Examples
This compilation approach gives you the flexibility to have consistent prompt templates while still allowing runtime customization for specific use cases.
Managing Environments
You can easily manage different deployment environments for your prompts directly in the Helicone dashboard. Create and deploy prompts to production, staging, development, or any custom environment you need.Variables
Variables make your prompts dynamic and reusable. Define them once in your prompt template, then provide different values at runtime without changing your code.Variable Syntax
Variables use the format{{hc:name:type}}
where:
name
is your variable identifiertype
defines the expected data type
Supported Types
Type | Description | Example Values | Validation |
---|---|---|---|
string | Text values | "John Doe" , "Hello world" | None |
number | Numeric values | 25 , 3.14 , -10 | AI Gateway type-checking |
boolean | True/false values | true , false , "yes" , "no" | AI Gateway type-checking |
your_type_name | Any data type | Objects, arrays, strings | None |
Only
number
and boolean
types are validated by the Helicone AI Gateway, which will accept strings for any input as long as they can be converted to valid values.true
/false
(boolean)"yes"
/"no"
(string)"true"
/"false"
(string)
Schema Variables
Variables can be used within JSON schemas for tools and response formatting. This enables dynamic schema generation based on runtime inputs.Replacement Behavior
Value Replacement: When a variable tag is the only content in a string, it gets replaced with the actual data type:SDK Helpers
We provide SDKs for both TypeScript and Python that offer two ways to use Helicone prompts:- AI Gateway Integration - Use prompts through the Helicone AI Gateway
- Direct SDK Integration - Pull prompts directly via SDK
- Cleaner code: Automatically performs compilation and substitution in the router.
- Input traces: Traces inputs on each request for better observability in Helicone requests.
- Faster TTFT: The AI Gateway adds significantly less latency compared to the SDK.
Types and Classes
The SDK provides types for both integration methods when using the OpenAI SDK:
Both types extend the OpenAI SDK’s chat completion parameters and add:
Type | Description | Use Case |
---|---|---|
HeliconeChatCreateParams | Standard chat completions with prompts | Non-streaming requests |
HeliconeChatCreateParamsStreaming | Streaming chat completions with prompts | Streaming requests |
prompt_id
- Your saved prompt identifierenvironment
- Optional environment to target (e.g., “production”, “staging”)version_id
- Optional specific version (defaults to production version)inputs
- Variable values
messages
optional because Helicone prompts are expected to contain the required message structure. If your prompt template is empty or doesn’t include messages, you’ll need to provide them at runtime.For direct SDK integration:Methods
Both SDKs provide theHeliconePromptManager
with these main methods:
Method | Description | Returns |
---|---|---|
pullPromptVersion() | Determine which prompt version to use | Prompt version object |
pullPromptBody() | Fetch raw prompt from storage | Raw prompt body |
pullPromptBodyByVersionId() | Fetch prompt by specific version ID | Raw prompt body |
mergePromptBody() | Merge prompt with inputs and validation | Compilation result |
getPromptBody() | Complete compile process with inputs | Compiled body + validation errors |
Usage Examples
Both approaches are fully compatible with all OpenAI SDK features including function calling, response formats, and advanced parameters. The
HeliconePromptManager
, while not providing input traces, will provide validation error handling.