Skip to content

Authentication

All API requests require authentication via an API key passed in the Authorization header.

  1. Go to api.tokensupernova.com
  2. Sign up with your email (no phone number required)
  3. Navigate to API Keys in the console
  4. Click Create Key and copy it immediately

Include the key in the Authorization header of every request:

Terminal window
Authorization: Bearer tsn_live_xxxxxxxxxxxx
from openai import OpenAI
client = OpenAI(
api_key="tsn_live_xxx",
base_url="https://api.tokensupernova.com/v1",
)
Terminal window
curl "https://api.tokensupernova.com/v1/chat/completions" \
-H "Authorization: Bearer tsn_live_xxx" \
-H "Content-Type: application/json" \
-d '{...}'
  • 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
EnvironmentPrefixExample
Productiontsn_live_tsn_live_a1b2c3d4...
Test (future)tsn_test_tsn_test_a1b2c3d4...