Authentication

The Submagic API uses API key authentication to secure access to all endpoints. Every request must include a valid API key in the request headers.

Getting Your API Key

1

Create an Account

Sign up for a free account at app.submagic.co
2

Navigate to API Settings

Go to your account settings and click on the “API” tab
3

Generate API Key

Click “Generate API Key” to create your unique API key
4

Copy and Secure

Copy your API key immediately - you won’t be able to see it again!
Important: Your API key will only be shown once during generation. Make sure to copy and store it securely. If you lose your API key, you’ll need to regenerate a new one.

API Key Format

Submagic API keys follow this format:
sk-[64-character-hex-string]
Example:
sk-a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456

Authentication Method

Include your API key in the x-api-key header with every request:
x-api-key: sk-your-api-key-here

Example Requests

curl -X GET "https://api.submagic.co/v1/languages" \
  -H "x-api-key: sk-your-api-key-here"

API Key Security

Keep It Secret

Never expose your API key in client-side code, public repositories, or logs

Use Environment Variables

Store your API key in environment variables, not in your source code

Best Practices

Environment Variables

Store your API key in environment variables:
SUBMAGIC_API_KEY=sk-your-api-key-here

Server-Side Only

Never use your API key in client-side JavaScript, mobile apps, or any publicly accessible code. API keys should only be used from your secure backend servers.

Key Rotation

To regenerate your API key:
  1. Generate a new API key from your dashboard
  2. Update your applications with the new key
  3. Test that everything works with the new key
  4. The old key will be automatically invalidated

Authentication Errors

If authentication fails, you’ll receive a 401 Unauthorized response:
{
  "error": "UNAUTHORIZED",
  "message": "Invalid or missing API key"
}

Need Help?

If you’re having trouble with authentication contact our support team.