Skip to main content

Getting Your API Key

  1. Visit Legnext.ai Dashboard
  2. Navigate to API Keys section
  3. Generate a new API key
  4. Copy and store securely

Authentication Methods

Set your API key as an environment variable:
Then use it in your C# code:

Method 2: appsettings.json Configuration

For ASP.NET Core applications: appsettings.json:
Usage:

Method 3: User Secrets (Development)

For development environments:
Then access in code:

Complete Setup Example


Security Best Practices

  1. Never hardcode API keys
  2. Use different keys for different environments
  3. Never commit secrets to version control
  4. Rotate keys regularly
  5. Use secure storage in production (Azure Key Vault, AWS Secrets Manager)
  6. Enable HTTPS only

Testing Authentication


Next Steps