Authentication
How to authenticate with the RunRL API
Authentication
The RunRL client uses API key authentication to securely access the RunRL API. This page explains how to obtain and use your API key.
Obtaining an API Key
To obtain an API key:
- Sign up for an account at RunRL
- Navigate to your account settings
- Generate a new API key
- Copy the API key (it starts with
rl-
)
Using Your API Key
When initializing the RunRL client, you need to provide your API key:
API Key Validation
The RunRL client automatically validates your API key when you initialize it:
Environment Variables
For security best practices, it's recommended to store your API key as an environment variable rather than hardcoding it in your scripts:
You can set the environment variable in your shell:
Custom API Endpoints
By default, the RunRL client connects to the standard RunRL API endpoint. If you need to use a different endpoint (e.g., for testing or private deployments), you can specify it when initializing the client:
API Key Security
Keep your API key secure:
- Never commit your API key to version control
- Don't share your API key in public forums or documentation
- Rotate your API key periodically
- Use environment variables or secure secret management tools
Error Handling
If authentication fails, the RunRL client will raise an AuthenticationError
:
Next Steps
Once you've successfully authenticated, you can start using the RunRL client to manage your runs and other resources.