Authentication

Learn how to authenticate with the Lesan AI API using API keys.

All API requests to Lesan AI require authentication using an API key.

Getting Your API Key

To get your API key, you need to create one through the API key management endpoints. API keys are prefixed with sk_live_ or sk_test_.

Using Your API Key

Include your API key in the Authorization header of every request:

text
Authorization: Bearer YOUR_API_KEY

Example Request

curl https://api.lesan.ai/transcribe \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://example.com/audio.mp3",
    "language": "am"
  }'

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables to store keys
  • Rotate keys regularly
  • Use different keys for different environments (test vs production)

For more details, see the API Reference.