Classify content

POST
/v1/risk/content/classify

Scores text people post on your platform (a profile bio, a comment, a listing) for spam, phishing, malware and fraud with an AI model, with zero data retention. Returns scores only: you decide what they mean. Neither the text nor the scores are stored, and request logs keep no body for this endpoint. Takes up to 3 seconds; a failure is a 503 you can retry or treat as unknown. Limited per organization as well as per key. Sandbox keys use markers instead of a model: [coss-test:phishing] scores 0.99, [coss-test:spam:0.4] exactly 0.4, everything else 0.01.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.

Header Parameters

Coss-Version?"2026-10-10"

The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.

Value in"2026-10-10"

Request Body

application/json
  1. body
text*string

The text to classify (a profile bio, a comment, a listing). The model reads the first 8,000 characters.

Length1 <= length <= 50000

Response Body

The scores.

application/json
  1. response

Scores only: COSS never decides what they mean for you. Neither the text nor the scores are stored.

object*"risk_content_classification"
Value in"risk_content_classification"
scores*

Per category, the model's probability (0-1) that the content belongs to it. Scores are not calibrated: pick thresholds by looking at your own traffic.

truncated*boolean

The text was longer than the model reads: only its beginning was classified.

import { Coss } from "coss";const coss = new Coss({  apiKey: process.env.COSS_API_KEY,  baseUrl: "https://api.coss.com",});const { data, error } = await coss.risk.classify({  text: "Earn $5,000 a week from home! DM me on Telegram: t.me/fast-cash",});
{  "object": "risk_content_classification",  "scores": {    "spam": 0.91,    "phishing": 0.04,    "malware": 0.01,    "fraud": 0.86  },  "truncated": false}