Part of Cipher  ›

Cipher, inside your own forms

Score every response for bots, rushing, copying and AI writing from your own stack. Install the package, add a key, and get your first score in minutes.

$ pnpm add @surbee/cipher
quickstart.ts
import { Cipher } from '@surbee/cipher'

const cipher = new Cipher({ apiKey: process.env.CIPHER_API_KEY })

// Score your first survey response
const result = await cipher.validate({
  responses: [
    { question: 'Would you recommend us?', answer: 'Yes' },
  ],
  behavioralMetrics: tracker.getMetrics(),
})

console.log(result.score)          // 0.94
console.log(result.recommendation) // 'keep'

103µs

to score a whole response with the in-house checks

$0.003

per response at Pro, which reads how each written answer was produced

$0.06

per response at Max, with every Cipher check switched on

What you can do with Cipher SDK

Core API

Validate any response

Pass survey responses with behavioral metrics. Get instant quality scores, recommendations, and detailed check results.

validate.ts
const result = await cipher.validate({
  responses: submission.responses,
  behavioralMetrics: tracker.getMetrics(),
})

result.score          // 0.94
result.recommendation // 'keep'

Configuration

Pick a level and thresholds

Pick a level: 1 Basic, 2 Pro or 3 Max. Set your own score thresholds for reject and review. Pro adds how each written answer was produced and a light AI review. Max adds checks across responses, network checks and a web search for copied answers.

config.ts
const cipher = new Cipher({
  apiKey: process.env.CIPHER_API_KEY,
  level: 3,
  thresholds: { fail: 0.4, review: 0.7 },
})

Advanced

Batch and fraud-ring detection

Validate many responses in one call. Turn on cross-respondent analysis at the Max level to surface coordinated fraud rings across the whole batch.

batch.ts
const batch = await cipher.validateBatch({
  submissions,
  crossAnalysis: true, // Max level
})

batch.summary.avgScore
batch.fraudIndicators?.fraudRingScore

Basic level

Fast checks, no charge

Basic is free. It runs the speed, attention, straight-lining, pasting, automation and device checks with no AI review, so it returns in milliseconds.

lightweight.ts
const cipher = new Cipher({
  apiKey: process.env.CIPHER_API_KEY,
  level: 1, // Basic, no AI review
})

// Fast, server-side, no AI latency
const result = await cipher.validate({
  responses: submission.responses,
  deviceInfo: tracker.getDeviceInfo(),
})

FAQ

Billing, keys and what runs where.

Pay as you go. You top up prepaid API credits in the developer console and each scored response draws from them. Credits never expire, and there is no plan to buy.

The Basic level runs in-house with no AI calls, in microseconds, at no charge. Pro and Max add AI checks for written answers and cost a little more per response.

Yes. The SDK runs the same engine and the same checks that score every Surbee survey, through an adapter for your own forms.

From the developer console at platform.surbee.dev, where you also see usage, top up credits and manage billing.

Ready to screen your first response?

Pay only for what you screen, with credits that never expire.