Tutorial: Bring Your Own Keys (BYOK) Setup Guide
Learn how to configure BYOK in SPRAPP to use your own API keys for maximum flexibility and cost control.
BYOKAPI keysLLM councilmulti-model AIcost control
What is BYOK?
Bring Your Own Keys (BYOK) lets you use your own API keys with SPRAPP, providing:
- Direct billing from providers
- Full usage visibility
- Maximum model access
- Cost control
Supported Providers
| Provider | Models | Pricing Model |
|---|---|---|
| OpenAI | GPT family | Pay per token |
| Anthropic | Claude family | Pay per token |
| Gemini family | Pay per token | |
| xAI | Grok family | Pay per token |
| OpenRouter | 300+ models | Aggregated billing |
| Zhipu | GLM family | Pay per token |
Step 1: Get Your API Keys
OpenAI
- Go to platform.openai.com
- Navigate to API Keys
- Create new secret key
- Copy immediately (shown once)
Anthropic
- Go to console.anthropic.com
- Navigate to API Keys
- Create new key
- Copy the key
Google (Gemini)
- Go to aistudio.google.com
- Get API key
- Copy the key
OpenRouter
- Go to openrouter.ai
- Settings > Keys
- Create new key
- Copy the key
Step 2: Configure in SPRAPP
- Log into SPRAPP
- Go to Settings > API Keys
- Click "Add New Key"
- Select provider
- Paste your key
- Click "Verify & Save"
Verification
SPRAPP tests each key with a small query to verify it works.
Step 3: Create Council with BYOK
{
"name": "BYOK Council",
"models": [
"anthropic:claude-3.5-sonnet",
"openai:gpt-4o",
"google:gemini-1.5-pro",
"xai:grok-2"
],
"billing": "byok"
}
Security Best Practices
Key Storage
- Keys encrypted at rest
- Never exposed in logs
- Scoped to minimum permissions
Key Rotation
- Rotate quarterly
- Immediately if compromised
- Use separate keys per environment
Access Control
- Limit who can view keys
- Audit key access
- Remove unused keys
Cost Monitoring
In SPRAPP
- View usage per provider
- Track spending trends
- Set budget alerts
In Provider Consoles
- OpenAI: Usage dashboard
- Anthropic: Console usage
- Google: Cloud billing
- OpenRouter: Credits page
Troubleshooting
Key Not Working
- Verify key is active
- Check for spaces in paste
- Confirm sufficient credits
- Try regenerating key
Rate Limits
- Each provider has limits
- Upgrade tier if needed
- Distribute across keys
Unexpected Charges
- Check usage in provider console
- Review query logs
- Set budget limits
BYOK vs SPRAPP Billing
| Feature | BYOK | SPRAPP Billing |
|---|---|---|
| Direct provider access | Yes | No |
| Usage in provider console | Yes | No |
| Single bill | No | Yes |
| Model variety | All | Selected |
| Setup complexity | Higher | Lower |
BYOK is recommended for power users and enterprises. You're now ready to use your own keys!