API Documentation

Everything you need to integrate moder8r into your application

Authentication

Learn how to authenticate your API requests securely with moder8r.

API Key Format

moder8r API keys follow a specific format for easy identification and security:

m8r_sk_32_character_secret_key
Prefix

m8r_sk_ identifies this as a moder8r secret key

Secret

32 characters of cryptographically secure random data

Making Authenticated Requests

Include your API key in the Authorization header using the Bearer token format:

Authorization Header
Authorization: Bearer m8r_sk_your_actual_key_here

Here's a complete example request:

Complete Request Example
curl -X POST https://api.moder8r.app/v1/moderate/text \
  -H "Authorization: Bearer m8r_sk_your_actual_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Text content to moderate"
  }'

Getting Your API Key

1

Sign up for an account

Create your moder8r account at moder8r.app

2

Navigate to Dashboard

Go to the dashboard and click on "API Keys" in the sidebar

3

Generate API Key

Click "Generate API Key" and copy the key immediately - it will only be shown once

Security Best Practices

⚠️ Never expose API keys in client-side code

API keys should only be used in server-side applications. Never include them in:

  • • Frontend JavaScript code
  • • Mobile app source code
  • • Public GitHub repositories
  • • Browser developer tools

✅ Do

  • • Store keys in environment variables
  • • Use HTTPS for all requests
  • • Rotate keys regularly
  • • Monitor API usage
  • • Use different keys per environment

❌ Don't

  • • Hardcode keys in source code
  • • Share keys in chat or email
  • • Use HTTP (non-encrypted)
  • • Commit keys to version control
  • • Use production keys in development

Environment Variables

Store your API key securely using environment variables:

.env File
# .env file
MODER8R_API_KEY=m8r_sk_your_actual_key_here

Usage in different languages:

Node.js Example
// Node.js
const apiKey = process.env.MODER8R_API_KEY;

const response = await fetch('https://api.moder8r.app/v1/moderate/text', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ content: 'Text to moderate' })
});
Python Example
# Python
import os
import requests

api_key = os.getenv('MODER8R_API_KEY')

response = requests.post(
    'https://api.moder8r.app/v1/moderate/text',
    headers={
        'Authorization': f'Bearer {api_key}',
        'Content-Type': 'application/json',
    },
    json={'content': 'Text to moderate'}
)