How to score an answer with the ClearRun API
Send the answer to POST https://api.clearrun.net/api/score. If you also have the question that produced it, send both to POST /api/evaluate. Both need an API key. A verified free account can create one developer key. Neither checks facts.
Last updated
Score an answer
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." }'
responseText is required. You can add modelId to record which model wrote the answer. Any string works.
The SDK method client.score() calls this same route.
Score an answer with its question
curl -s https://api.clearrun.net/api/evaluate \
-H "Authorization: Bearer $CLEARRUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "When was the Eiffel Tower finished?",
"responseText": "It was definitely finished in 1925, everyone agrees."
}'
From the SDK:
const { verdict } = await client.evaluate({
prompt: 'Where is the Eiffel Tower?',
responseText: 'The Eiffel Tower is in Berlin.',
});
Keys and errors
- No key or a bad key returns 401.
- A key that is not a free developer key returns 403
API_ACCESS_REQUIRED. A verified free account can create one developer key. Paste Check and signed-in chat do not use it.
The response includes a verdict and a receipt. Keep the verdictId. You can look it up later at GET /api/verify/{verdictId}, with no key. On the command line, clearrun score calls /api/score.