Overview
While BoostGPT provides hosted API keys for all supported providers, you can bring your own API keys (BYOK) for greater control, cost optimization, and compliance requirements.
Benefits of BYOK
Cost Control Direct billing from providers, potentially lower costs for high-volume applications
Rate Limits Use your own API tier and rate limits without sharing with other BoostGPT users
Compliance Meet regulatory requirements that mandate direct provider relationships
Billing Transparency Direct invoices from AI providers with detailed usage breakdowns
Supported Providers
All major AI providers support BYOK through the BoostGPT dashboard:
Models: Grok 3, Grok 4 FastGet API Key: console.x.ai Cost: Pay-per-request pricing
Models: DeepSeek V3, DeepSeek R1Get API Key: platform.deepseek.com Cost: Competitive pay-as-you-go pricing
Models: Mistral Small, Medium, LargeGet API Key: console.mistral.ai Cost: Usage-based pricing
Models: Llama 3.x, DeepSeek Llama, Qwen modelsGet API Key: console.groq.com/keys Cost: Generous free tier, competitive paid pricing
Models: All local models (no API key needed)Setup: Install Ollama locally and provide host URLCost: Free (self-hosted)
Setup Guide
Step 1: Get Your API Key
Choose Your Provider
Select the AI provider you want to use (OpenAI, Anthropic, Google, etc.)
Create Account
Sign up for an account with the provider if you don’t have one
Generate API Key
Navigate to the provider’s API key management page and create a new key Give your key a descriptive name like “BoostGPT Production” to track usage
Copy API Key
Copy the API key immediately - most providers only show it once! Store your API key securely. Never commit it to version control or share it publicly.
Step 2: Add API Key to BoostGPT
Navigate to Integrations
Click on Integrations in the sidebar navigation
Select Provider
Find and click on the AI provider you want to configure (e.g., OpenAI, Anthropic)
Enter API Key
Paste your API key into the provided field
Select Agents
Choose which agents should use this API key You can use different API keys for different agents to separate billing or apply different rate limits.
Save Configuration
Click Save to apply your custom API key
Test the Integration
Send a test message to verify the API key works correctly
Step 3: Monitor Usage
Track your usage and costs directly in your provider’s dashboard. BoostGPT will use your API key for all requests from the selected agents.
Usage with SDKs
Once configured in the dashboard, your agents automatically use your custom API keys. No code changes needed!
Core SDK
import { BoostGPT } from 'boostgpt' ;
const client = new BoostGPT ({
project_id: process . env . BOOSTGPT_PROJECT_ID ,
key: process . env . BOOSTGPT_API_KEY
});
// This bot will use your custom OpenAI API key (if configured in dashboard)
const botResponse = await client . createBot ({
name: 'My BYOK Bot' ,
model: 'gpt-5-mini' ,
instruction: 'You are a helpful assistant.' ,
status: 'active'
});
// Chat requests automatically use your API key
const chatResponse = await client . chat ({
bot_id: botResponse . response . id ,
message: 'Hello!'
});
Router SDK
import { Router , DiscordAdapter } from '@boostgpt/router' ;
const router = new Router ({
apiKey: process . env . BOOSTGPT_API_KEY ,
projectId: process . env . BOOSTGPT_PROJECT_ID ,
defaultBotId: process . env . BOOSTGPT_BOT_ID , // Bot using your custom API key
adapters: [
new DiscordAdapter ({
discordToken: process . env . DISCORD_TOKEN
})
]
});
// Router automatically uses your custom API key
router . onMessage ( async ( message , context ) => {
// Handle commands or return null for AI
if ( message . content === '/status' ) {
return 'Using your own API key!' ;
}
return null ; // BoostGPT handles with your key
});
await router . start ();
Override API Key Per Request (Advanced)
For Ollama or custom setups, you can override the provider configuration per request:
// Override Ollama host per request
const chatResponse = await client . chat ({
bot_id: 'your-bot-id' ,
provider_host: 'http://custom-server:11434' ,
message: 'Hello from custom host!'
});
// Override OpenAI API key per request (if needed)
const customResponse = await client . chat ({
bot_id: 'your-bot-id' ,
provider_key: 'sk-custom-key-here' , // Use specific API key
message: 'Hello!'
});
Cost Comparison
BoostGPT Credits vs BYOK
BoostGPT credits provide simplicity and predictability, while BYOK offers potential cost savings for high-volume usage.
Scenario BoostGPT Credits BYOK Recommendation Low Volume (<1M tokens/month)Simple, predictable More setup, similar cost Use Credits High Volume (>10M tokens/month)Pay per credit Direct provider pricing Use BYOK Multiple Models Single credit balance Separate provider bills Use Credits Compliance Required Shared infrastructure Direct provider relationship Use BYOK Development/Testing Easy to start Requires API keys Use Credits
Example Cost Analysis
Scenario: 1M GPT-4o Mini requests per month
BoostGPT Credits: 1M credits × 0.01 = 0.01 = 0.01 = 10,000
BYOK with OpenAI: ~$8,000 (OpenAI direct pricing)
Savings: ~$2,000/month (20%)
For high-volume production workloads (>1M requests/month), BYOK typically offers 15-30% cost savings.
Security Best Practices
Protect Your API Keys
Use Environment Variables
Never hardcode API keys in your code OPENAI_API_KEY = sk-...
ANTHROPIC_API_KEY = sk-ant-...
GOOGLE_AI_KEY = AIza...
Generate new API keys every 3-6 months and revoke old ones
Use Different Keys Per Environment
Separate API keys for development, staging, and production
Configure rate limits at the provider level to prevent unexpected costs
Set up billing alerts with your providers to monitor unexpected usage spikes
Each team member should have their own API keys, never share
Monitor API Usage
Provider Dashboards
Check usage in OpenAI Console, Anthropic Console, etc.
Set Billing Alerts
Configure alerts at 50 , 50, 50 , 100, $500 thresholds
Review Monthly
Analyze usage patterns and optimize model selection
Track by Agent
Use different API keys for different agents to track costs separately
Troubleshooting
Cause: API key is incorrect, expired, or revokedSolutions:
Double-check the API key was copied correctly
Verify the key hasn’t been revoked in provider dashboard
Generate a new API key
Ensure no extra spaces or characters
Cause: Too many requests for your API tierSolutions:
Upgrade your API tier with the provider
Implement request throttling
Use exponential backoff retries
Consider using BoostGPT credits for overflow
Cause: API account hasn’t been verified or has no creditsSolutions:
Add payment method to provider account
Verify email/phone with provider
Check billing status in provider dashboard
Add credits or update payment method
API key not working in BoostGPT
Cause: Configuration issue in BoostGPT dashboardSolutions:
Verify API key was saved correctly
Check that the agent is selected to use the custom key
Test the API key directly with provider’s API
Re-enter and save the API key
Cause: Higher than expected usage or expensive model selectionSolutions:
Review usage in provider dashboard
Switch to more cost-effective models (e.g., GPT-4o Mini instead of GPT-5)
Set max_reply_tokens limits
Implement caching for common queries
Enable billing alerts
Migration from Credits to BYOK
Calculate Usage
Review your monthly credit usage in BoostGPT dashboard
Estimate Costs
Compare BoostGPT credit costs vs direct provider pricing
Obtain API Keys
Sign up with providers and generate API keys
Test in Staging
Configure API keys for a test agent first
Gradual Rollout
Move agents to BYOK one at a time, monitoring costs
Monitor Performance
Track response times and error rates after migration
FAQ
Can I use both BoostGPT credits and BYOK?
Yes! You can use BoostGPT credits for some agents and BYOK for others. Configure API keys per-agent in the dashboard.
Do I still need a BoostGPT subscription with BYOK?
Yes. BoostGPT provides the infrastructure, SDKs, routing, and management tools. BYOK only changes where API calls are billed.
What happens if my API key runs out of credits?
Requests will fail with an error. BoostGPT will NOT fallback to BoostGPT credits automatically. Monitor your provider balances.
Can I switch back to BoostGPT credits?
Yes! Simply remove your custom API key from the Integration settings, and your agents will use BoostGPT credits again.
Does BYOK work with all features?
Yes. All BoostGPT features work identically with BYOK, including reasoning modes, multi-channel routing, and integrations.
How secure is storing my API key in BoostGPT?
API keys are encrypted at rest and in transit. Only your agents use your keys, never shared with other users. See our security docs for details.
Next Steps