Overview ​
TendSocial AI allows your company to use your own API keys for AI services. This gives you:
- Direct billing with AI providers (OpenAI, Anthropic, Google, etc.)
- Cost transparency - see exactly what you're spending
- Usage control - manage your own rate limits and quotas
- Privacy - your API keys stay within your organization
Supported AI Providers ​
- OpenAI - GPT-4, GPT-3.5, DALL-E 3
- Anthropic - Claude 3 (Opus, Sonnet, Haiku)
- Google AI - Gemini Pro, Gemini Pro Vision
- Azure OpenAI - Enterprise OpenAI models
Getting Started ​
Step 1: Obtain API Keys from Providers ​
OpenAI ​
- Go to platform.openai.com
- Sign up or log in to your account
- Navigate to API Keys in your account settings
- Click Create new secret key
- Copy the key (you won't be able to see it again!)
- Set up billing in your OpenAI account
Cost Estimates:
- GPT-4: ~$0.03 per 1K tokens (input), ~$0.06 per 1K tokens (output)
- GPT-3.5: ~$0.0015 per 1K tokens
- DALL-E 3: ~$0.04 per image (standard), ~$0.08 (HD)
Anthropic (Claude) ​
- Go to console.anthropic.com
- Sign up for an account
- Navigate to API Keys
- Click Create Key
- Name your key and copy it
- Add credits to your account
Cost Estimates:
- Claude 3 Opus: ~$0.015 per 1K tokens (input), ~$0.075 per 1K tokens (output)
- Claude 3 Sonnet: ~$0.003 per 1K tokens (input), ~$0.015 per 1K tokens (output)
Google AI (Gemini) ​
- Go to makersuite.google.com/app/apikey
- Sign in with your Google account
- Click Create API Key
- Copy the key
Cost Estimates:
- Gemini Pro: Currently free tier available, paid tiers vary
Azure OpenAI ​
- Set up an Azure account and subscription
- Create an Azure OpenAI resource
- Deploy your chosen models
- Get your API key and endpoint from the resource
Step 2: Add Your API Key to TendSocial AI ​
Navigate to Company Settings
- Click on your profile in the top-right corner
- Select Company Settings
- Go to the API Keys tab
Add New API Key
- Click the Add API Key button
- Fill in the form:
- Key Name: Give it a descriptive name (e.g., "Production OpenAI Key")
- Provider: Select the AI provider
- API Key: Paste your API key
Verify the Key
- The system will test your key to ensure it's valid
- If successful, you'll see a confirmation message
- Your key preview will show (e.g., "sk-...xyz123")
Security Notes
- Your full API key is encrypted and stored securely
- Only the last 4 characters are visible in the UI
- You can rotate keys at any time
Step 3: Set Default Provider (Optional) ​
You can set a default provider for different operations:
- Text Generation: Choose your preferred model for post generation
- Image Generation: Choose your preferred model for images
- Analysis: Choose your preferred model for brand analysis
This allows you to balance cost and quality based on your needs.
Managing Your API Keys ​
Viewing Keys ​
In the API Keys section, you'll see:
- Key name
- Provider
- Key preview (last 4 characters)
- Status (Active/Inactive)
- Usage count
- Last used date
- Created date
Editing Keys ​
You can:
- Rename a key
- Deactivate a key (temporarily disable without deleting)
- Delete a key (permanent removal)
- Set expiration date for automatic deactivation
Usage Tracking ​
Each API key tracks:
- Total calls made using this key
- Last used timestamp
- Usage count per day/week/month
This helps you:
- Monitor which keys are being used
- Detect unusual activity
- Plan for key rotation
Best Practices ​
Security ​
- Never share your API keys with anyone outside your organization
- Rotate keys regularly (every 90 days recommended)
- Use separate keys for development and production
- Set rate limits in your provider's dashboard
- Monitor usage regularly for unexpected spikes
Cost Management ​
- Start with lower-tier models (e.g., GPT-3.5 instead of GPT-4)
- Set spending alerts in your provider dashboards
- Monitor usage analytics in TendSocial AI
- Use the right model for the task:
- Simple posts: GPT-3.5 or Claude Haiku
- Complex analysis: GPT-4 or Claude Opus
- Images: DALL-E 3 or Stable Diffusion
Key Rotation ​
When rotating keys:
- Create a new key in your provider's dashboard
- Add the new key to TendSocial AI
- Test the new key with a sample generation
- Deactivate the old key
- Monitor for any issues
- Delete the old key after 24 hours
Usage Analytics & Billing ​
Company Dashboard ​
View comprehensive analytics:
- Total API calls across all providers
- Token usage per provider
- Estimated costs (calculated from provider pricing)
- Content generated (posts, images)
- Usage trends over time
Per-User Analytics ​
Company admins can view:
- Individual user activity
- Team performance comparisons
- Most active users
- Usage by department/role
Exporting Reports ​
Export usage data for:
- Internal billing (charge back to departments)
- Budget planning
- Compliance reporting
- Financial forecasting
Troubleshooting ​
"Invalid API Key" Error ​
Causes:
- Key was copied incorrectly (extra spaces, missing characters)
- Key has been revoked in the provider's dashboard
- Insufficient credits/quota in your provider account
- Key doesn't have required permissions
Solutions:
- Double-check the key in your provider's dashboard
- Generate a new key and try again
- Verify your account has active billing
- Check rate limits and quotas
"Rate Limit Exceeded" Error ​
Causes:
- Too many requests in a short time
- Provider rate limits reached
- Account quota exhausted
Solutions:
- Check your provider's rate limits
- Upgrade your provider account tier
- Spread out requests over time
- Use a different provider temporarily
"Insufficient Quota" Error ​
Causes:
- No credits remaining in your account
- Free tier limits exceeded
- Payment method declined
Solutions:
- Add credits to your provider account
- Update payment method
- Upgrade to a paid tier
Cost Comparison ​
Sample Costs for 1,000 Posts ​
| Provider | Model | Estimated Cost |
|---|---|---|
| OpenAI | GPT-3.5 Turbo | $1.50 - $3.00 |
| OpenAI | GPT-4 | $30 - $60 |
| Anthropic | Claude Haiku | $2.50 - $5.00 |
| Anthropic | Claude Sonnet | $5 - $10 |
| Anthropic | Claude Opus | $15 - $30 |
| Gemini Pro | Free - $5 |
Note: Costs vary based on post length and complexity
Sample Costs for 1,000 Images ​
| Provider | Model | Quality | Cost |
|---|---|---|---|
| OpenAI | DALL-E 3 | Standard | $40 |
Appendix: API Key Security Checklist ​
- [ ] Keys are stored securely (encrypted)
- [ ] Only authorized team members have access
- [ ] Keys are rotated regularly (every 90 days)
- [ ] Usage is monitored for anomalies
- [ ] Spending alerts are set up with providers
- [ ] Rate limits are configured appropriately
- [ ] Keys are revoked immediately if compromised
- [ ] Separate keys for dev/staging/production
- [ ] Keys are never committed to code repositories
- [ ] Access logs are reviewed regularly