How to score text with POST /api/score

Send POST /api/score with { "responseText": "Our API never stores customer data." } and your key. You get back verdict and receipt. Use it when you have the answer but not the prompt.

Last updated

Steps

  1. Send the request

    curl -s https://api.clearrun.net/api/score \
      -H "Authorization: Bearer $CLEARRUN_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "responseText": "The Eiffel Tower is definitely in Berlin." }'
  2. Read the verdict

    verdict.score, verdict.risk, verdict.summary and verdict.verdictId.

Request fields

Request fields
FieldRequiredNotes
responseTextYesThe text to score, 10 to 100,000 characters
modelIdNoA label for the model that wrote it
workspaceIdNoWhich workspace's receipt chain to use

Errors

  • 400 responseText is required
  • 400 responseText is too short to score (CONTENT_TOO_SHORT) under 10 characters
  • 400 responseText too long (CONTENT_TOO_LONG, with maxLength 100000 and actualLength) over 100,000
  • 400 Request blocked (ACTION_NOT_ALLOWED)
  • 400 Content blocked (CONTENT_BLOCKED), the same on score, evaluate and chat. See Why am I getting 400 'Request blocked'?
  • 402 Insufficient credits
  • 429 Rate limit exceeded

Have the prompt?

Use POST /api/evaluate. See How to score an answer and its prompt with POST /api/evaluate.