Overview
Merit uses environment variables for different features. Here’s what you need for each:| Feature | Required Variables | Get Access |
|---|---|---|
| Basic Testing | None | Built-in |
| AI Predicates | MERIT_API_KEY | Contact us |
| Error Analyzer | Your own LLM keys | Direct from provider |
AI Predicates (LLM-as-a-Judge)
AI predicates (has_facts, has_topics, etc.) call the Merit cloud service.
Required
.env
Optional
.env
Get API Access
Contact us to get your Merit API key.Error Analyzer (Bring Your Own Key)
Merit Analyzer uses your LLM provider credentials directly. Currently supports Anthropic models via direct API or AWS Bedrock.Anthropic (Direct)
.env
AWS Bedrock (Anthropic)
.env
Loading Environment Variables
Merit automatically loads.env files from:
- Current working directory
- Project root (if different)
.env File
Create a.env file in your project root:
.env
Shell Export
Or export directly in your shell:CI/CD
Store as secrets in your CI/CD platform: GitHub Actions:Quick Reference
I want to use AI predicates in my tests
.env
I want to run the error analyzer
I want both features
.env
Troubleshooting
”MERIT_API_KEY not configured”
You need Merit API credentials to use AI predicates:- Contact us to get an API key
- Add to
.envfile:
“API key not configured” (Analyzer)
The analyzer needs LLM provider credentials:- Get API key from your provider (OpenAI, Anthropic, etc.)
- Add to
.envfile:
Variables not loading
- ✅ Check
.envfile is in project root - ✅ Check file is named exactly
.env(not.env.txt) - ✅ Restart terminal/IDE after creating
.env - ✅ Check for typos in variable names
Security Best Practices
Add to .gitignore
.gitignore
Use Different Keys Per Environment
Rotate Keys Regularly
- Change keys periodically
- Revoke compromised keys immediately
- Use separate keys for dev/staging/production