How to authenticate ClearRun API requests
Send your API key in the Authorization header as Bearer crun_.... A verified free account can create one developer key. On Pro, Business and Enterprise, API access stays on until you turn it off. GET /api/verify/{verdictId} and the public keys need no key.
Last updated
Steps
Create a key
At api.clearrun.net/account/keys. Copy it right away.
Send it in the header
curl -s https://api.clearrun.net/api/score \ -H "Authorization: Bearer $CLEARRUN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "responseText": "The capital of France is Paris." }'
Also accepted
X-API-Key: crun_... works too. Authorization: Bearer is the documented way.
Which routes need a key
| Route | Key |
|---|---|
POST /api/score, /api/evaluate, /api/chat | Yes |
GET /api/verify/chain, GET /api/audit/export, GET /api/usage | Yes, or a signed-in session |
GET /api/verify/{verdictId}, GET /.well-known/jwks.json | No |
Auth errors
- 401
Missing Authorization: Bearer <apiKey>: no key sent. - 401
Unauthorized: the key is wrong or no longer works. - 403
API_ACCESS_REQUIRED: the key is not a free developer key on a free account. - 403
EMAIL_NOT_VERIFIED: the email is not verified, so a developer key cannot be created. - 403
API_ACCESS_DISABLED: API access is off on a paid plan. That switch does not turn a free developer key off.