Authentication

How to authenticate your API requests.

Authentication

TurboAPI uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.

API Keys

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

Getting Your API Key

  1. Sign up at TurboAPI
  2. Go to API Keys
  3. Click "Create New Key"
  4. Copy your secret key

Authentication Request

Include your API key in the Authorization header:

curl https://api.turboapi.ai/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

Environment Variables

Store your API key securely:

# .env
TURBOAPI_API_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxxxx

Using in Code

import { TurboAPI } from '@turboapi/sdk';

const client = new TurboAPI({
  apiKey: process.env.TURBOAPI_API_KEY,
});

Key Types

Key TypePrefixUsage
Livesk_live_Production requests
Testsk_test_Testing (no real charges)
Restrictedsk_restrict_Limited permissions

Security Best Practices

  • ✅ Use environment variables
  • ✅ Rotate keys regularly
  • ✅ Use restricted keys for frontend
  • ❌ Never commit keys to Git
  • ❌ Don't expose keys in URLs
  • ❌ Don't share in chat/slack
If you believe an API key has been compromised, revoke it immediately in the Dashboard.