getSecurityToken) to later retrieve results securely on your backend, orgetSecurityResult) directly in your frontend.isAIUsageDetected() or automatically by passing autoFlagAIUsage: true to init(). Use one approach or the other, never both.getSecurityToken, getSecurityResult, isAIUsageDetected, checkQualityQuestions.getQualityQuestions.autoFlagAIUsage) follows the same billing rule — it reuses the session token and does not create an extra charge beyond the first billable call.| Method | Purpose | Billable* | Returns |
|---|---|---|---|
getSecurityToken() | Generates a token (recommended: backend retrieves result) | ✅ | { token } |
getSecurityResult() | Retrieves Security Result directly in frontend | ✅ | { token, result } |
isAIUsageDetected() | Detects AI tools or behaviors during the session | ✅ | { token } (or { token, result } if includeResults=true) |
checkQualityQuestions() | Validates answers to quality questions | ✅ | { token } (or { token, result } if includeResults=true) |
getQualityQuestions() | Retrieves 4 randomized validation questions (3 multiple-choice, 1 open-ended) | ❌ | Question[] |
isAIUsageDetected, checkQualityQuestions) rely on the includeResults setting to control whether their results are visible on the frontend.init(). The API allows you to call methods in any order, and you can invoke them multiple times within the same session.Note: With autoFlagAIUsageenabled, automatic detection begins only after the firstgetSecurityToken()orgetSecurityResult()call in the session. Use eitherisAIUsageDetected()orautoFlagAIUsage, not both.
isAIUsageDetected() make sure you do it after the open-ended question was answered. This maximizes the effectiveness of AI Detection while still giving you flexibility to call it again later in the session if needed.