The AgentTest backend uses API keys to authenticate requests. All API endpoints are protected and require a valid API key to be included in your requests.
To authenticate your API calls, you must include an x-api-key
header with your secret API key.
Example using cURL:
Replace YOUR_SUPER_SECRET_API_KEY
with the actual API key you’ve configured for your backend instance, and https://your-agenttest-backend.example.com
with the URL of your deployed AgentTest backend.
The API key is defined in the .env
file in the root of your AgentTest backend project. You need to set the API_KEY
variable:
API_KEY
value is what the backend server will expect in the x-api-key
header.Keep your API key secure!
Your API key grants access to your AgentTest backend, including assigning variants and logging results.
Do not expose it in client-side browser code or commit it to your version control system if the .env
file is not gitignored (by default, .env
files should be in .gitignore
).
Treat it like a password.
If an API request is made without an x-api-key
header, or if the provided key is invalid, the server will respond with a 401 Unauthorized
HTTP status code.