Body
text
string | array<string>
required
The text to check for spam.
Response
Indicates whether the call was successful.
Usage information for the API call.
Number of input tokens processed.
Number of output tokens generated.
Number of tokens processed during inference time.
Total number of tokens used (input + output).
When text is a string, returns an object. When text is an array, returns an array of objects.
Indicates whether the text is spam. If the text is not spam, this will be
false.
The spam score of the text. The lower the score, the less likely
it will be spam.
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.validate.spamcheck({
"text": "Congratulations! You've won a free iPhone! Click here to claim now!"
})
{
"success": true,
"check": {
"score": 0.95,
"is_spam": true
},
"_usage": {
"input_tokens": 20,
"output_tokens": 14,
"inference_time_tokens": 509,
"total_tokens": 543
}
}