API Authentication
How to authenticate with the MoreMind API
Authentication
All MoreMind API requests require authentication using API keys. This guide covers how to obtain and use your API keys securely.
Getting Your API Key
API access is available on Pro and Enterprise plans. Free and Student plans have limited API access.
- Log in to your MoreMind account
- Go to Settings > API Keys
- Click Generate New API Key
- Copy your key immediately (it won't be shown again)
- Store it securely
Using API Keys
Bearer Token Authentication
Include your API key in the Authorization header of every request:
curl -X GET https://api.moremind.com/v1/papers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Example Requests
Python:
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.get(
"https://api.moremind.com/v1/papers",
headers=headers
)
print(response.json())
JavaScript:
const headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
};
fetch('https://api.moremind.com/v1/papers', { headers })
.then(response => response.json())
.then(data => console.log(data));
cURL:
curl https://api.moremind.com/v1/papers \
-H "Authorization: Bearer YOUR_API_KEY"
Security Best Practices
Never expose your API key in client-side code, public repositories, or version control systems.
Do's
✅ Store API keys in environment variables ✅ Use different keys for development and production ✅ Rotate keys regularly ✅ Revoke keys if compromised ✅ Use server-side API calls only
Don'ts
❌ Don't commit keys to Git ❌ Don't share keys publicly ❌ Don't hardcode keys in applications ❌ Don't use the same key across multiple apps ❌ Don't log API keys
Example: Environment Variables
.env file:
MOREMIND_API_KEY=your_api_key_here
Python:
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv('MOREMIND_API_KEY')
Node.js:
require('dotenv').config();
const apiKey = process.env.MOREMIND_API_KEY;
Rate Limiting
API requests are rate-limited based on your subscription plan:
| Plan | Requests/Hour | Requests/Day |
|---|---|---|
| Free | 10 | 50 |
| Student | 100 | 1,000 |
| Pro | 1,000 | 10,000 |
| Enterprise | Custom | Custom |
Rate Limit Headers
Every API response includes rate limit information:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1673539200
Handling Rate Limits
When you exceed the rate limit, you'll receive a 429 Too Many Requests response:
{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded. Please try again later.",
"retry_after": 3600
}
Best practices:
- Monitor rate limit headers
- Implement exponential backoff
- Cache responses when possible
- Batch requests when available
Error Responses
Authentication Errors
401 Unauthorized - Missing or invalid API key:
{
"error": "unauthorized",
"message": "Invalid API key"
}
403 Forbidden - Insufficient permissions:
{
"error": "forbidden",
"message": "Your plan does not have access to this endpoint"
}
Managing API Keys
Creating Multiple Keys
You can create multiple API keys for different purposes:
- Development key
- Production key
- Testing key
- Third-party integration keys
Revoking Keys
If a key is compromised:
- Go to Settings > API Keys
- Find the compromised key
- Click Revoke
- Generate a new key
- Update your applications
Key Permissions
Enterprise users can create keys with specific permissions (read-only, write-only, etc.).
Webhooks Authentication
For webhook endpoints, MoreMind includes a signature in the X-MoreMind-Signature header:
import hmac
import hashlib
def verify_webhook(payload, signature, secret):
expected = hmac.new(
secret.encode(),
payload.encode(),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)
Testing
Use our sandbox environment for testing:
Sandbox URL:
https://api-sandbox.moremind.com/v1
Test API Key:
- Available in your dashboard under Settings > API Keys > Sandbox
Sandbox environment uses test data and doesn't count against your rate limits or usage quotas.
Next Steps
- API Endpoints - Explore available endpoints
- API Examples - Sample code and implementations
- API Status - Check API uptime and status
Need help? Contact api-support@moremind.com or visit our API Forum.