The Recall AI SDK uses API key authentication to securely access the Recall AI API. All API requests must include a valid API key.
Getting your API key
To use the SDK, you’ll need an API key from Recall AI. Contact the Recall AI team or check your dashboard to obtain your API key.
Keep your API key secure and never commit it to version control. Use environment variables to store sensitive credentials.
Basic authentication
Authenticate by passing your API key when initializing the Recall client:
import { Recall } from 'recall_sdk';
const recall = new Recall({
apiKey: 'your-api-key',
region: 'us-east-2'
});
How authentication works
The SDK uses token-based authentication. When you initialize the Recall client, your API key is automatically included in all HTTP requests.
Authentication implementation
The SDK uses a singleton pattern to create an Axios instance with your API key in the authorization header:
// From recall-axios.ts
axios.create({
headers: {
Authorization: `Token ${apiKey}`,
Accept: 'application/json'
}
});
This Axios instance is reused across all API calls, ensuring your API key is consistently included in every request.
Using environment variables
For security best practices, store your API key in environment variables:
const recall = new Recall({
apiKey: process.env.RECALL_API_KEY,
region: process.env.RECALL_REGION || 'us-east-2'
});
Create a .env file in your project root and add it to .gitignore to prevent accidentally committing your credentials.
Example .env file
RECALL_API_KEY=your-api-key-here
RECALL_REGION=us-east-2
Authentication errors
If your API key is invalid or missing, you’ll receive an authentication error. Common issues include:
- 401 Unauthorized: Invalid or expired API key
- 403 Forbidden: Valid API key but insufficient permissions
See the error handling guide for more details on handling authentication errors.