Authentication

Maniac uses API keys for authentication. This guide covers how to obtain, configure, and manage your API keys securely.

Getting Your API Key

1. Sign Up for Maniac

Visit maniac.aiarrow-up-right and create an account:

  1. Click "Sign Up"

  2. Currently, we support sign ins with GitHub and Google.

2. Create an API Key

In the Maniac dashboard:

  1. Create a new organization and project.

  2. Navigate to ProjectSettingsAPI Keys

  3. Click "Create a Key"

  4. Give your key a descriptive name (e.g., "Production API", "Development")

  5. Click "Submit," and copy your key.

⚠️ Important: API keys are scoped per user and project.

Configuring Authentication

Set your API key as an environment variable:

Linux/macOS:

Windows:

Python Code:

Method 2: Configuration File

Create a configuration file at ~/.maniac/config.yaml:

Python Code:

Method 3: Direct in Code

⚠️ Security Warning: Never hardcode API keys in production code or commit them to version control.

Security Best Practices

1. Environment-Specific Keys

Use different API keys for different environments:

2. Key Rotation

Regularly rotate your API keys:

  1. Generate a new API key

  2. Update your environment variables/config

  3. Test the new key

  4. Delete the old key

3. Least Privilege Access

Create keys with minimal required permissions:

4. Monitoring Usage

Monitor your API key usage in the dashboard:

  • Track request volumes

  • Monitor error rates

  • Set up usage alerts

  • Review access patterns

Managing Multiple Keys

Team Environments

For team development, consider:

Troubleshooting Authentication

Common Error Messages

Invalid API Key

Solution: Check that your API key is correct and hasn't been revoked.

Permission Denied

Solution: Check your key's permissions in the dashboard.

Rate Limit Exceeded

Solution: Implement rate limiting in your code or upgrade your plan.

Debugging Authentication Issues

Enable debug logging:

Environment Variables Reference

Variable
Description
Required

MANIAC_API_KEY

Your API key

Yes

MANIAC_ENVIRONMENT

Environment (production/sandbox)

No

MANIAC_REGION

Preferred region

No

MANIAC_TIMEOUT

Request timeout (seconds)

No

MANIAC_MAX_RETRIES

Max retry attempts

No

Next Steps

Last updated