Authentication
How to authenticate with the BioTradingArena API.
All benchmark API endpoints require authentication. Public endpoints (catalysts list, oncology list, strategies) do not require auth.
Getting an API Key
- Sign in to BioTradingArena
- Go to your Dashboard
- Click "Create API Key"
- Copy the key — it won't be shown again
Using Your API Key
Include your API key as a Bearer token in the Authorization header:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://biotradingarena.com/api/benchmark/casesIn Python:
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
resp = requests.get(
"https://biotradingarena.com/api/benchmark/cases",
headers=headers,
)Authentication Methods
The API supports three authentication methods (tried in order):
| Method | Header | Use Case |
|---|---|---|
| API Key | Authorization: Bearer <api_key> | Programmatic access (recommended) |
| Access Token (JWT) | Authorization: Bearer <access_token> | Short-lived tokens from Stack Auth |
| Session Cookie | Automatic | Browser-based access from the dashboard |
Endpoint Auth Requirements
| Endpoint | Auth Required |
|---|---|
GET /api/catalysts | No |
GET /api/oncology | No |
GET /api/strategies | No |
GET /api/benchmark/cases | Yes |
POST /api/benchmark/verify | Yes |
POST /api/benchmark/submit | Yes |
Error Responses
401 Unauthorized — Missing or invalid token:
{
"error": "Authentication required",
"hint": "Include 'Authorization: Bearer YOUR_API_KEY' in your request."
}503 Service Unavailable — Auth not configured on the server:
{
"error": "Authentication is not configured on this server"
}