Overview
The Avala API uses API keys to authenticate requests. All API requests must include a valid API key, which you can obtain from the Avala dashboard.Get your API key
Sign in to Avala
Navigate to app.avala.ai and sign in to your account.
Open API settings
Go to Settings → API Keys or visit app.avala.ai/settings/api-keys.
API keys are prefixed with
avk_ to help identify them.Authentication methods
The SDK supports two ways to provide your API key:Environment variable (recommended)
Set theAVALA_API_KEY environment variable, and the SDK will automatically use it:
Direct configuration
Alternatively, pass the API key directly when creating the client:Environment-specific keys
Use different API keys for different environments (development, staging, production):.env.development
.env.production
.env file using a package like dotenv:
Authentication errors
If your API key is invalid or missing, the SDK will throw an error:Additional configuration
The SDK constructor accepts additional configuration options:Base URL configuration
You typically don’t need to change the base URL unless you’re working with a self-hosted Avala instance or a custom environment.
Request timeout
Adjust the timeout for long-running requests:Creating a new account programmatically
The SDK includes asignup() function to create new Avala accounts programmatically. This is useful for automation or integration workflows.
Parameters
Account creation options
Email address for the new account
Password for the new account
User’s first name
User’s last name
Custom API base URL (defaults to production)
Request timeout in milliseconds (default: 30000)
Returns
API key for the newly created account. Save this securely - you won’t be able to retrieve it again.
The
signup() function does not require an existing API key. It returns an API key for the newly created account.Security best practices
Use environment variables
Use environment variables
Store API keys in environment variables or secret management tools, never in source code.
Rotate keys regularly
Rotate keys regularly
Periodically rotate your API keys, especially if you suspect they may have been compromised.
Use different keys per environment
Use different keys per environment
Create separate API keys for development, staging, and production environments.
Restrict key permissions
Restrict key permissions
If your Avala plan supports it, create keys with limited scopes for specific use cases.
Monitor key usage
Monitor key usage
Track API key usage in the Avala dashboard to detect unusual activity.
Revoke compromised keys immediately
Revoke compromised keys immediately
If an API key is exposed, revoke it immediately from the dashboard and create a new one.
Next steps
Quick start guide
Make your first API call with the Avala SDK
API reference
Explore all available resources and methods