Authentication
Authentication is essential for every request to the Synoria API. Each request needs a valid API key to identify your application and authorize access. To enhance security, store API keys in environment variables rather than hardcoding them. This practice minimizes risks and eases deployment. This guide will help you set up a secure environment, initialize the Synoria client, and ensure authentication is correctly configured.
Configure Your API Key
Store your API key as an environment variable. This prevents sensitive credentials from being exposed in source code or version control while making them accessible during runtime.
Initialize an Authenticated Client
Load your environment variables and initialize the Synoria client. Once configured, every request automatically includes the required authentication credentials.
Verify Your Connection
Before sending production requests, verify that your API key is valid by retrieving your available models. This is a quick way to confirm authentication has been configured correctly.
Security Best Practices
Never expose API keys in frontend code, public repositories, or client-side applications. Rotate credentials regularly, assign separate keys for development and production, and revoke unused keys immediately to maintain a secure environment.

