Factuality

POST
Check the factuality of a given text compared to a reference.

Request

This endpoint expects an object.
reference
stringRequired
The reference text for comparison.
text
stringRequired
The the text to be checked for factuality.

Response

This endpoint returns an object
id
stringOptional
Unique ID for the chat completion.
object
stringOptional
Type of object (chat completion).
created
integerOptional
Timestamp of when the chat completion was created.
checks
list of objectsOptional
The set of vectorized data.

Errors

POST
1curl -X POST https://api.predictionguard.com/factuality \
2 -H "x-api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "reference": "The President shall receive in full for his services during the term for which he shall have been elected compensation in the aggregate amount of 400,000 a year, to be paid monthly, and in addition an expense allowance of 50,000 to assist in defraying expenses relating to or resulting from the discharge of his official duties.",
6 "text": "The president of the united states can take a salary of one million dollars"
7}'
1{
2 "id": "fact-JJtvGAUpioXgzwBGpwWiRVb3DSWgo",
3 "object": "factuality_check",
4 "created": 1717674781,
5 "checks": [
6 {
7 "index": 0,
8 "score": 0.7879657745361328,
9 "status": "success"
10 }
11 ]
12}