Skip to main content

1. Get your API key

1

Create an account

Sign up at classer.ai with Google
2

Generate API key

Go to API Keys and create a new key
3

Copy the key

Save it somewhere safe — you’ll only see it once

2. Install the SDK

pip install classer

3. Classify text

Pick the single best label for a piece of text.
import classer
import os

os.environ["CLASSER_API_KEY"] = "your-api-key"

result = classer.classify(
    text="I need help resetting my password",
    labels=["billing", "technical", "sales"]
)

print(f"Label: {result.label}")           # "technical"
print(f"Confidence: {result.confidence}")  # 0.94

4. Tag with multiple labels

Return all labels that match above a confidence threshold.
result = classer.tag(
    text="Breaking: Tech stocks surge amid AI boom",
    labels=["politics", "technology", "finance", "sports"],
    threshold=0.3
)

for t in result.labels:
    print(f"{t.label}: {t.confidence}")
# technology: 0.92
# finance: 0.78

5. Use descriptions for better accuracy

Add label descriptions when labels are ambiguous.
result = classer.classify(
    text="We need a solution for 500 users, what's your enterprise pricing?",
    labels=["hot", "warm", "cold"],
    descriptions={
        "hot": "Ready to buy, asking for pricing or demo",
        "warm": "Interested but exploring options",
        "cold": "Just browsing, no clear intent"
    }
)

print(result.label)  # "hot"

Next steps