ClassifAI

Getting Started

Start using ClassifAI in minutes - classify text and images with automatic label inference

What is ClassifAI?

ClassifAI is a self-improving classification API for text and images. Use it to categorize content, route requests, analyze sentiment, moderate content, and more - without training your own models.

Key Features:

  • Classify text and images (separately or together)
  • Automatic label inference from descriptions
  • Self-improving through feedback loops
  • Anonymous and authenticated tiers
  • Model Context Protocol (MCP) support for AI agents

Installation

No installation needed. Just use curl or any HTTP client.

Install the Python SDK:

pip install classifai-sdk

Quick Start

1. Make Your First Classification

curl -X POST https://api.classifai.dev/classify \
  -H "Content-Type: application/json" \
  -d '{
    "content": [
      {"type": "text", "content": "This product is amazing! Fast shipping too."}
    ],
    "labels": ["positive", "negative", "neutral"]
  }'
from classifai import ClassifAI

client = ClassifAI()

result = client.classify(
    content="This product is amazing! Fast shipping too.",
    labels=["positive", "negative", "neutral"]
)

print(f"Label: {result['label']}")
print(f"Confidence: {result['labels'][result['label']]:.0%}")

Response:

{
  "labels": {
    "positive": 0.92,
    "negative": 0.05,
    "neutral": 0.03
  },
  "label": "positive",
  "detection_id": "det_abc123...",
  "project_id": "proj_xyz789",
  "labels_used": ["positive", "negative", "neutral"],
  "ground_truth_url": "https://api.classifai.dev/ground_truth/det_abc123...",
  "processing_time_ms": 1166
}

2. Provide Feedback to Improve

Help the model learn by providing the correct label:

curl -X POST https://api.classifai.dev/ground_truth/det_abc123... \
  -H "Content-Type: application/json" \
  -d '{"ground_truth": "positive"}'
feedback = client.submit_feedback(
    detection_id=result["detection_id"],
    ground_truth="positive"
)

The system learns from this feedback and improves accuracy for your specific use case.

3. Use Automatic Label Inference

Instead of providing labels, describe what you want to classify:

curl -X POST https://api.classifai.dev/classify \
  -H "Content-Type: application/json" \
  -d '{
    "content": [
      {"type": "text", "content": "The food was cold and service was slow"}
    ],
    "description": "Restaurant reviews with quality indicators"
  }'
result = client.classify(
    content="The food was cold and service was slow",
    description="Restaurant reviews with quality indicators"
)

print(f"Inferred labels: {result['labels_used']}")

The system will automatically infer appropriate labels like "poor_quality", "slow_service", etc.

Access Tiers

TierAPI KeyRate LimitsRequest Size LimitCost
Free (Test)Optional10/min, 100/day500 KBFree
HobbyYes10/min, 1,000/day2.5 MB$5/month
ProductionYes100/min, 10,000/day10 MB$25/month

Note: Request size limits apply to the entire request body, including all text and base64-encoded images. For tips on reducing request sizes, see Image Optimization.

Use Cases

Sentiment Analysis

Classify customer reviews, support tickets, or social media posts.

Content Moderation

Automatically flag inappropriate content, spam, or policy violations.

Request Routing

Route customer inquiries to the right team based on intent and urgency.

Image Classification

Classify product images, detect content types, or categorize visual content.

Multi-Modal Analysis

Combine text and images for richer classification (e.g., product reviews with photos).

Next Steps

Get an API Key

Ready to try it out? Sign up now to get started for free.