Overview
Dakora uses two types of API keys:- Dakora API Keys - Authenticate SDK requests to your project
- LLM Provider Keys - Execute prompts with AI models (OpenAI, Anthropic, etc.)
Dakora API Keys
Dakora API keys authenticate your SDK requests and scope them to a specific project.Creating an API Key
- Sign in to app.dakora.io
- Navigate to Settings > API Keys
- Click Create API Key
- Give it a descriptive name (e.g., “Production Server”, “CI Pipeline”)
- Copy the key immediately - it’s only shown once

Key Format
Dakora API keys use the prefixdkr_:
Using the Key
Set the key as an environment variable:Managing Keys
View and revoke keys in Settings > API Keys:
- Each project can have up to 10 API keys
- Keys can be revoked at any time
- Revoked keys stop working immediately
LLM Provider Keys
To execute prompts against AI models, configure your provider API keys.Supported Providers
| Provider | Environment Variable | Models |
|---|---|---|
| OpenAI | OPENAI_API_KEY | gpt-4o, gpt-4, gpt-3.5-turbo |
| Anthropic | ANTHROPIC_API_KEY | claude-3-opus, claude-3-sonnet |
GOOGLE_API_KEY | gemini-pro, gemini-1.5-pro | |
| Azure OpenAI | AZURE_API_KEY | azure/gpt-4, azure/gpt-35-turbo |
Setting Provider Keys
Add to your environment or.env file:
Security Best Practices
Use Environment Variables
Use Environment Variables
Never hardcode API keys in your source code.
Add .env to .gitignore
Add .env to .gitignore
Use Separate Keys per Environment
Use Separate Keys per Environment
Create different keys for dev, staging, and production.
Rotate Keys Regularly
Rotate Keys Regularly
Rotate keys periodically and revoke old ones.
Monitor Usage
Monitor Usage
Check the Dakora dashboard for unusual activity.
Troubleshooting
Authentication Error
Authentication Error
Error:
401 UnauthorizedSolutions:- Verify your
DAKORA_API_KEYis set correctly - Check the key hasn’t been revoked
- Ensure the key belongs to the correct project
Provider Key Not Found
Provider Key Not Found
Error:
API key not found for providerSolutions:- Check the environment variable name matches the provider
- Restart your terminal after setting variables
- Verify with
echo $OPENAI_API_KEY
.env Not Loading
.env Not Loading
Solutions:
- Install python-dotenv:
pip install python-dotenv - Call
load_dotenv()before importing Dakora - Ensure
.envis in your working directory
Next Steps
Quick Start
Get up and running with Dakora
SDK Reference
Explore SDK methods