Authentication
All API requests require authentication via an API key passed in the Authorization header.
Getting an API Key
Section titled “Getting an API Key”- Go to api.tokensupernova.com
- Sign up with your email (no phone number required)
- Navigate to API Keys in the console
- Click Create Key and copy it immediately
Using Your API Key
Section titled “Using Your API Key”Include the key in the Authorization header of every request:
Authorization: Bearer tsn_live_xxxxxxxxxxxxWith OpenAI SDK
Section titled “With OpenAI SDK”from openai import OpenAI
client = OpenAI( api_key="tsn_live_xxx", base_url="https://api.tokensupernova.com/v1",)With curl
Section titled “With curl”curl "https://api.tokensupernova.com/v1/chat/completions" \ -H "Authorization: Bearer tsn_live_xxx" \ -H "Content-Type: application/json" \ -d '{...}'Security Best Practices
Section titled “Security Best Practices”- Never commit API keys to version control
- Use environment variables:
export TSN_API_KEY="tsn_live_xxx" - Rotate keys periodically from the console
- Each key is scoped to your account — use separate keys for dev/prod
Key Formats
Section titled “Key Formats”| Environment | Prefix | Example |
|---|---|---|
| Production | tsn_live_ | tsn_live_a1b2c3d4... |
| Test (future) | tsn_test_ | tsn_test_a1b2c3d4... |