# Jev AI Batch Classifier & Lead Triage (`renatozanetti9/jev-batch-classifier`) Actor

Classify leads, support tickets, and user content in milliseconds at ~$0.00002/item using TypeSafe AI's Jev (via TypeSafe or OpenRouter).

- **URL**: https://apify.com/renatozanetti9/jev-batch-classifier.md
- **Developed by:** [Renato Zanetti](https://apify.com/renatozanetti9) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Jev AI Batch Classifier & Lead Triage

Classify hundreds or thousands of **sales leads**, **support tickets**, and **user-generated content** in milliseconds with calibrated probabilities — at **~$0.00002 per item** (~50,000 items per $1).

Powered by **TypeSafe AI's Jev** (`System One` decision model) with native support for both **OpenRouter** (`typesafe/jev-1.14`) and **TypeSafe AI** (`POST /v1/systemone`).

***

### Why Use Jev Instead of a Standard LLM?

- **Millisecond Latency:** Non-autoregressive decision evaluation without slow token-by-token text generation.
- **Deterministic Typed Outputs:** Returns calibrated probabilities (`noul`, `choice`, `score`) directly usable in **n8n**, **Make**, **Zapier**, or backend webhooks — zero regex or JSON-repair hacks.
- **Fraction of LLM Costs:** Tested at **~$0.00002 per lead** on OpenRouter (output tokens are free on TypeSafe AI).

***

### Built-In Presets

| Preset | What It Classifies | Output Fields |
| :--- | :--- | :--- |
| **`lead_triage`** | Sales & inbound messages | `has_buying_intent`, `is_spam_or_unsubscribe`, `lead_tier` (`enterprise`, `smb`, `individual`, `not_a_lead`), `urgency` (`0–2`) |
| **`support_ticket`** | Customer support queue | `is_urgent`, `department` (`billing`, `technical`, `account`, `other`), `frustration_level` (`0–2`) |
| **`content_moderation`** | Comments, reviews & UGC | `is_spam`, `is_toxic_or_abusive`, `action` (`approve`, `flag_for_review`, `reject`) |
| **`custom`** | Your own schema | Any `noul`, `choice`, or `score` questions via `customQuestions` |

***

### Example Input (OpenRouter)

```json
{
  "provider": "openrouter",
  "apiKey": "sk-or-v1-...",
  "preset": "lead_triage",
  "concurrency": 5,
  "items": [
    "Hi! We have 50 seats and need an enterprise quote by Friday.",
    "Unsubscribe me from this mailing list immediately."
  ]
}
```

### Example Output

```json
{
  "index": 0,
  "input": "Hi! We have 50 seats and need an enterprise quote by Friday.",
  "provider": "openrouter",
  "preset": "lead_triage",
  "classification": {
    "model": "typesafe/jev-1.14-20261014",
    "answers": {
      "has_buying_intent": { "type": "noul", "noul": 0.98 },
      "is_spam_or_unsubscribe": { "type": "noul", "noul": 0.04 },
      "lead_tier": { "type": "choice", "choice": "enterprise", "confidence": 0.97 },
      "urgency": { "type": "score", "score": 1.98, "confidence": 0.97 }
    }
  },
  "error": null
}
```

***

### Bring Your Own Key (BYOK)

- **OpenRouter:** Set `provider: "openrouter"` and paste your OpenRouter API key (`https://openrouter.ai/keys`).
- **TypeSafe AI Direct:** Set `provider: "typesafe"` and paste your TypeSafe AI key (`https://console.typesafe.ai`).

# Actor input Schema

## `provider` (type: `string`):

Use 'typesafe' for direct TypeSafe AI System One API or 'openrouter' for an OpenRouter API key.

## `apiKey` (type: `string`):

Your TypeSafe AI or OpenRouter API key (BYOK - Bring Your Own Key).

## `preset` (type: `string`):

Choose a ready-to-use classification schema or 'custom' to supply your own Jev questions.

## `items` (type: `array`):

Array of strings or JSON objects to classify in batch.

## `customQuestions` (type: `object`):

Used when preset is 'custom'. Define Jev questions using noul, choice, or score types.

## `model` (type: `string`):

Model alias (e.g. 'jev-latest' for TypeSafe AI, or an OpenRouter model slug).

## `apiBaseUrl` (type: `string`):

Leave empty to use the default endpoint for the selected provider.

## `concurrency` (type: `integer`):

Number of parallel classification requests.

## Actor input object example

```json
{
  "provider": "typesafe",
  "preset": "lead_triage",
  "items": [
    "Hi! We have 50 seats and need an enterprise quote by Friday.",
    "Unsubscribe me from this mailing list immediately."
  ],
  "model": "jev-latest",
  "concurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

JSON items containing Jev probabilities, discrete choices, scores, and per-item errors.

## `overview` (type: `string`):

Formatted table view of classification results.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("renatozanetti9/jev-batch-classifier").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("renatozanetti9/jev-batch-classifier").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call renatozanetti9/jev-batch-classifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,renatozanetti9/jev-batch-classifier"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AjGisthg6SmMbr1hY/builds/RzGWCCYGBQIBbSl59/openapi.json
