Getting an API Key for Custom AI Providers
Before you can use a custom AI provider with Definer, you'll need to obtain an API key from your chosen service. An API key is essentially your digital passport – it identifies you to the AI service and allows you to access their models.
While each provider has its own specific process, the general steps are quite similar across most services.
General Steps to Get an API Key
1. Create an Account
Visit your chosen AI provider's website and sign up for an account. Most services require:
- A valid email address
- Basic personal or company information
- Phone number verification (for some providers)
2. Navigate to API Settings
Once logged in, look for sections typically labeled:
- "API Keys"
- "Developer Settings"
- "API Access"
- "Dashboard"
- "Console"
These are usually found in your account settings, developer portal, or main dashboard.
3. Generate a New API Key
- Click "Create API Key," "Generate Key," or similar button
- Give your key a descriptive name (e.g., "Definer Extension")
- Some providers let you set permissions or usage limits at this stage
4. Copy and Store Your Key Safely
- Copy the key immediately – many providers only show it once for security reasons
- Store it securely (password manager, secure notes app)
- Never share your API key publicly or commit it to code repositories
5. Add Billing Information (If Required)
Many providers require payment information even for free tiers:
- Add a credit card or payment method
- Set up billing alerts to avoid unexpected charges
- Review the pricing structure and free tier limits
What to Look For
When exploring a new AI provider, check for:
- OpenAI Compatibility: Look for phrases like "OpenAI-compatible API," "Chat Completions endpoint," or "/v1/chat/completions"
- Documentation: Good providers have clear API docs with examples
- Pricing: Understand the cost per token, request, or usage model
- Rate Limits: Know any restrictions on requests per minute/hour
- Free Tier: Many services offer free credits to get started
Security Best Practices
Protect Your API Key
- Treat it like a password – never share it publicly
- Don't include it in screenshots or support requests
- Regenerate it if you suspect it's been compromised
Monitor Usage
- Most providers offer usage dashboards
- Set up billing alerts to avoid surprise charges
- Review your usage regularly, especially when testing
Use Appropriate Permissions
- If the provider offers scoped keys, use the minimum permissions needed
- Some services let you restrict keys to specific models or usage patterns
Common Gotchas
Free Tier Limitations
- Many free tiers have daily or monthly limits
- Some require phone verification or credit card on file
- Free access might be limited to certain models
Model Access
- Not all API keys have access to all models
- Premium models often require paid plans
- Some models have waitlists or approval processes
Regional Restrictions
- Some providers aren't available in all countries
- API endpoints might vary by region
- Check terms of service for geographic limitations
Provider-Specific Tips
For Open Source Hosting Services
Services like Fireworks AI, DeepInfra, or Groq typically have straightforward signup processes with immediate API access.
For Official Model Providers
Companies like Mistral AI or Anthropic (via third-party hosts) might have more verification steps or approval processes.
For Self-Hosted Solutions
If you're running your own server (vLLM, llama.cpp), you might not need an API key at all, or you might set your own authentication token.
Testing Your Setup
Once you have your API key:
- Check the documentation for the correct API host URL
- Note the exact model names available to your key
- Test with a simple request using curl or a similar tool (if you're comfortable with that)
- Try it in Definer with a simple word lookup
When Things Go Wrong
If your API key isn't working:
- Double-check the key format – some providers use specific prefixes
- Verify your account status – ensure it's activated and in good standing
- Check billing – many services suspend access for payment issues
- Review rate limits – you might be hitting usage restrictions
- Contact support – most providers have helpful developer support teams
Remember, getting an API key is usually just the first step. Take some time to familiarize yourself with your provider's documentation, pricing, and available models to get the most out of your setup.
If you need help, feel free to create a new post with the "Help" flair in the r/lumetrium_definer subreddit.