Skip to main content
POST
/
v1
/
evaluate
Evaluate
curl --request POST \
  --url https://guard-api.metatext.ai/v1/evaluate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "messages": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "application": "your_application_id",
  "policy_ids": [],
  "policies": [],
  "override_response": "I'm sorry, I can't assist with that.",
  "correction_enabled": false,
  "fail_fast": true
}
EOF
{
  "time": 123,
  "created": 123,
  "status": "<string>",
  "object": "eval",
  "policy_violations": {},
  "correction": {
    "choices": [
      {
        "role": "user",
        "content": "<string>"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
messages
Messages · object[]
required

Rails and policies will be evaluated based on the messages. Policies requires at least the user and assistant, and system message is optional.

application
string
default:your_application_id
policy_ids
string[]

If provided, will override the default policies enabled on console.

policies
Policy · object[]
override_response
string | null
Example:

"I'm sorry, I can't assist with that."

correction_enabled
boolean
default:false

If enabled and any violation happens, will provide a compliant correction to the user input. Override_response has priority.

fail_fast
boolean
default:true

Response

Successful Response

time
number
required
created
integer
required
status
string
required
object
string
default:eval
policy_violations
Policy Violations · object
correction
Correction · object