Deploy prompt versions to different environments (production, staging, custom) and access them through theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/helicone/helicone/llms.txt
Use this file to discover all available pages before exploring further.
@helicone/prompts SDK or directly via the Helicone AI Gateway.
Deployment Environments
Environments let you deploy different prompt versions for different use cases:Production
The live version that serves real user traffic. Deploy stable, tested versions here.
Staging
Pre-production testing environment. Validate changes before going live.
Custom
Create any environment:
dev, qa, canary, feature-branch, etc.Environment Properties
- One version can be deployed to multiple environments
- Multiple versions can be deployed to different environments simultaneously
- Default environment is
production - Environment names are case-sensitive
- No predefined environment limits - create as many as needed
Deploying in the UI
Select a version
Open your prompt and navigate to the Versions tab. Select the version you want to deploy.
Choose environment
Click Deploy and select or create an environment:
- Select existing:
production,staging, etc. - Create new: Enter a custom environment name
Deploying via API
Deploy to Environment
Remove from Environment
Using Deployed Prompts
SDK Integration
The@helicone/prompts SDK is the recommended way to use prompts in your application.
Installation
Basic Usage
Environment Selection
Specific Version
Bypass environment deployment and use a specific version directly:AI Gateway Integration
Use prompts directly through the Helicone AI Gateway without the SDK.Setup
Using Prompts
- Fetches the prompt from the specified environment
- Substitutes variables with your
inputs - Merges with any additional
messagesyou provide - Routes to the appropriate LLM provider
- Returns the response
Variables and Inputs
Prompts can include typed variables using the syntax{{hc:variableName:type}}.
Supported Types
string: Text valuesnumber: Numeric valuesboolean: True/false values
Example Prompt
Providing Inputs
Type Validation
The SDK validates input types at runtime:Advanced Usage
Merging Messages
Append additional messages to the prompt:Overriding Parameters
Override prompt parameters at runtime:Streaming Responses
Deployment Strategies
Blue-Green Deployment
- Deploy new version to
staging - Test thoroughly
- Deploy to
production - Monitor metrics
- Rollback if needed (redeploy previous version)
Canary Deployment
- Deploy new version to
canaryenvironment - Route 5-10% of traffic to canary
- Monitor error rates and quality
- Gradually increase traffic
- Promote to
productionwhen confident
Feature Branch Testing
- Create environment named after feature branch:
feature-new-tone - Deploy experimental version
- Test in isolation
- Promote to
stagingwhen ready
Monitoring Deployments
Track prompt usage and performance in the Helicone dashboard:- Requests per version: See which versions are active
- Environment usage: Monitor traffic by environment
- Error rates: Detect issues with new deployments
- Cost per version: Track spending changes
- Latency: Measure performance impact
Best Practices
Test in staging first: Always validate in non-production before deploying to production
Use semantic versioning: Major versions for breaking changes, minor for improvements
Monitor after deployment: Watch error rates and user feedback for 24-48 hours
Keep environment names consistent: Use standardized names across projects
Troubleshooting
Version Not Found
If the SDK returns “version not found”:- Verify the prompt ID is correct
- Check that the version is deployed to the specified environment
- Ensure your API key has access to the organization
Variable Validation Errors
If you receive validation errors:- Check that all required variables have inputs
- Verify input types match variable declarations
- Review the
errorsarray for specific issues
Gateway Integration Issues
If prompts aren’t working through the gateway:- Confirm
baseURLis set tohttps://ai-gateway.helicone.ai - Verify
prompt_idis correct - Check that the environment exists and has a deployed version
Next Steps
Experiments
Compare prompt versions with A/B testing
Gateway
Learn more about the Helicone AI Gateway
