POST
/
criteria
/
judge
curl --request POST \
  --url https://api.openpipe.ai/api/v1/criteria/judge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "criterion_id": "<string>",
  "input": {
    "messages": [
      {
        "role": "system",
        "content": "<string>",
        "name": "<string>"
      }
    ],
    "tool_choice": "none",
    "tools": [
      {
        "function": {
          "name": "<string>",
          "parameters": {},
          "description": "<string>",
          "strict": true
        },
        "type": "function"
      }
    ]
  },
  "output": {
    "reasoning_content": "<string>",
    "content": null,
    "refusal": "<string>",
    "role": "assistant",
    "function_call": {
      "name": "",
      "arguments": ""
    },
    "tool_calls": [
      {
        "id": "<string>",
        "function": {
          "name": "<string>",
          "arguments": "<string>"
        },
        "type": "function"
      }
    ]
  }
}'
{
  "score": 123,
  "explanation": "<string>",
  "usage": {
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
criterion_id
string
required

The ID of the criterion to judge.

output
object
required

The completion message of the model.

input
object

Response

200
application/json
Successful response
score
number
required

A score of 0 means the output failed this completion, and a score of 1 means it passed. A criteria may also return a decimal scores between 0 and 1, indicating the model's confidence or 'likelihood' that the criteria passed.

explanation
string

An explanation of the score including the model's reasoning, if applicable.

usage
object