API Keys
Manage API keys for AI providers
API Keys Management
Configure API keys for AI providers to enable TalkCody's AI features. Securely store and manage credentials for multiple services.
Overview
TalkCody supports multiple AI providers, each requiring their own API key:
- OpenAI - GPT models
- Anthropic - Claude models
- Google - Gemini models
- OpenRouter - Multi-provider access
- Alibaba Qwen - Qwen models
- Zhipu AI - GLM models
- Ollama - Local models (no key needed)
You need at least one API key configured to use TalkCody. Multiple keys allow you to use different models and providers.
Adding API Keys
Open Settings
- Launch TalkCody
- Open Settings (⌘ + , on Mac, Ctrl + , on Windows/Linux)
- Navigate to API Keys section
Select Provider
Choose the AI provider you want to configure:
- Click + Add API Key
- Select provider from dropdown
Enter API Key
- Paste your API key in the input field
- Optionally set a custom name (e.g., "Work OpenAI", "Personal Anthropic")
- Configure additional settings if needed
Test Connection
- Click Test Key to verify it works
- Check that the connection succeeds
- Save the configuration
Getting API Keys
OpenAI
- Visit platform.openai.com
- Sign up or log in
- Navigate to API Keys section
- Click Create new secret key
- Copy the key (you won't see it again)
- Add to TalkCody
API Key Format: sk-...
Pricing: Pay-as-you-go, based on tokens
- GPT-4.1: ~$0.30-$1.20 per 1M tokens
- Free tier: $5 credit for new accounts
Anthropic (Claude)
- Visit console.anthropic.com
- Create account or sign in
- Go to API Keys
- Generate new key
- Copy and add to TalkCody
API Key Format: sk-ant-...
Pricing: Pay-as-you-go
- Claude 4.5 Sonnet: ~$3.00-$15.00 per 1M tokens
- Free tier: Credits for new users
Google AI (Gemini)
- Visit aistudio.google.com
- Sign in with Google account
- Click Get API Key
- Create new API key
- Copy to TalkCody
API Key Format: AIza...
Pricing: Generous free tier
- Free: 15 requests/minute, 1500 requests/day
- Paid: From $0.35 per 1M tokens
OpenRouter
- Visit openrouter.ai
- Sign up or log in
- Go to API Keys
- Create new key
- Add to TalkCody
API Key Format: sk-or-v1-...
Benefits:
- Access to 100+ models through one key
- Some free models available
- Unified billing
- Fallback routing
Pricing: Varies by model
- Free models: DeepSeek Chat, Gemini Flash
- Paid: Route to any supported model
Alibaba Qwen
- Visit dashscope.aliyun.com
- Create account
- Get API key from console
- Add to TalkCody
API Key Format: sk-...
Pricing: Competitive rates for Qwen models
Zhipu AI (GLM)
- Visit open.bigmodel.cn
- Register account
- Navigate to API Keys
- Generate key
- Add to TalkCody
API Key Format: Varies
Pricing:
- GLM-4.5 Air: Free tier available
- Other models: Pay-as-you-go
Ollama (Local)
No API key needed!
- Install Ollama from ollama.com
- Download models:
ollama pull llama2 - TalkCody auto-detects local Ollama
- Select Ollama models in model settings
Benefits:
- Completely free
- Full privacy
- Works offline
- No rate limits
Drawbacks:
- Requires local compute resources
- Smaller models, less capable
- Slower than cloud APIs
Configuring API Keys
Basic Configuration
Required fields:
- Provider: Which AI service
- API Key: Your authentication credential
Optional fields:
- Name: Custom identifier (e.g., "Work Account")
- Base URL: Custom API endpoint (advanced)
- Organization ID: For team accounts (OpenAI)
Advanced Configuration
Custom Base URLs
For OpenAI-compatible APIs or proxies:
Provider: OpenAI Compatible
API Key: your-key
Base URL: https://your-proxy.com/v1Use cases:
- Corporate proxies
- Self-hosted models
- Alternative providers
- Regional endpoints
Request Headers
Add custom headers if needed:
{
"X-Custom-Header": "value",
"X-Organization": "org-id"
}Timeout Settings
Configure request timeout (default: 120 seconds):
Timeout: 60000 (milliseconds)Recommendations:
- Fast models: 30-60 seconds
- Complex queries: 120+ seconds
- Streaming: 180+ seconds
Multiple Keys for Same Provider
You can configure multiple keys for one provider:
Example use cases:
- Personal and work accounts
- Different payment methods
- Separate projects
- Rate limit distribution
OpenAI (Personal) - sk-proj-personal...
OpenAI (Work) - sk-proj-work...Select which key to use in model settings or per conversation.
Managing API Keys
Viewing Keys
In the API Keys settings:
- See all configured providers
- Check key status (active/inactive)
- View last used timestamp
- See usage statistics (if supported by provider)
Security: API keys are partially masked (e.g., sk-proj-***...abc123). Click "Show" to reveal full key.
Testing Keys
Test any configured key:
- Select the key
- Click Test Connection
- TalkCody makes a minimal API call
- Results show success or error
Common test failures:
- Invalid key format
- Key revoked or expired
- Insufficient credits
- Network issues
- Rate limit exceeded
Updating Keys
To update an existing key:
- Select the key from list
- Click Edit
- Enter new API key
- Test and save
When to update:
- Key rotation (security best practice)
- Switching payment methods
- Upgrading account tier
Deleting Keys
Remove keys you no longer need:
- Select key
- Click Delete
- Confirm deletion
Deleting a key doesn't delete past conversations that used it. They remain accessible but can't generate new responses with that key.
Security Best Practices
Key Storage
TalkCody stores API keys:
- Encrypted on your local machine
- Never transmitted except to the provider's API
- Not backed up to cloud by default
- OS-level security using native credential storage
Key Rotation
Rotate keys periodically:
- Every 90 days for high-security environments
- When team members leave
- If key might be compromised
- After major version updates
Access Control
Recommended practices:
- Use separate keys for different projects
- Limit key permissions at provider level
- Monitor usage for anomalies
- Set spending limits with providers
Environment Variables
For teams, use environment variables:
export OPENAI_API_KEY="sk-proj-..."
export ANTHROPIC_API_KEY="sk-ant-..."TalkCody can read from environment variables (configure in settings).
Troubleshooting
"Invalid API Key" Error
Check:
- Key is copied correctly (no extra spaces)
- Key hasn't been revoked
- Using correct provider
- Key format matches provider
Fix:
- Re-copy key from provider
- Generate new key
- Verify provider selection
"Quota Exceeded" Error
Meaning: You've hit rate or spending limits
Solutions:
- Check provider dashboard for limits
- Add payment method
- Increase spending limits
- Wait for quota reset
- Use different model/provider
Connection Timeout
Causes:
- Network issues
- Provider outage
- Firewall blocking requests
Solutions:
- Check internet connection
- Verify provider status page
- Check firewall/proxy settings
- Try different network
Key Works in Browser but Not TalkCody
Possible issues:
- Firewall/proxy differences
- TalkCody using wrong base URL
- SSL certificate issues
Debug:
- Check base URL setting
- Temporarily disable firewall
- Contact IT if on corporate network
Provider-Specific Tips
OpenAI
- Organization ID: Add for team accounts
- Project Keys: Use project-specific keys for better tracking
- Rate Limits: Vary by account tier (free/pay-as-you-go/enterprise)
Anthropic
- Workspaces: Can have multiple workspaces with separate keys
- Claude Pro: Personal subscription doesn't provide API access
- Rate Limits: Generous for paid accounts
Google AI
- Free Tier: Very generous (1500 requests/day)
- No Credit Card: Free tier doesn't require payment method
- Quota: Refreshes daily
OpenRouter
- Credits: Pre-purchase credits for better rates
- Routing: Set preferences for model fallbacks
- Free Models: Access free models even without credits
Monitoring Usage
In TalkCody
View usage statistics:
- Settings → API Keys → Usage
- See requests per provider
- Approximate token counts
- Estimated costs
Provider Dashboards
Check actual usage and billing:
- OpenAI: platform.openai.com/usage
- Anthropic: Console dashboard
- Google: Cloud console
- OpenRouter: Dashboard
Setting Budgets
At provider level:
- Set monthly spending limits
- Configure email alerts
- Auto-stop when limit reached
In TalkCody (future feature):
- Set per-key budgets
- Track spending across providers
- Alert on high usage
Next Steps
- Model Settings - Configure which models to use
- Agent Configuration - Assign models to agents
- Quick Start - Start using TalkCody with your API keys
With API keys configured, you're ready to start using TalkCody's AI features!