Body
The key used to store the image on Jigsawstack file. Learn more about how to handle files in Jigsawstack’s Handling Files section.
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).
Indicates whether NSFW content was detected in the image.
Indicates whether nudity was detected in the image.
Indicates whether gore/violence was detected in the image.
Confidence score for NSFW content detection (0-1 scale).
Confidence score for nudity detection (0-1 scale).
Confidence score for gore/violence detection (0-1 scale).
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.validate.nsfw({
"url": "https://jigsawstack.com/preview/nsfw-example.jpg"
})
{
"success": true,
"nsfw": false,
"nudity": false,
"gore": false,
"nsfw_score": 0.8223792436143141,
"nudity_score": 0.08542560786008835,
"gore_score": 0.0015945120248943567,
"_usage": {
"input_tokens": 15,
"output_tokens": 60,
"inference_time_tokens": 312,
"total_tokens": 387
}
}