Text Classify API
Classify text into any categories you define using Claude AI via REST API. Unlike pre-trained classifiers locked to fixed categories (spam/not-spam, positive/negative), this API works with any categories you specify — making it useful for routing, tagging, and organizing any type of content.
Try it live →How it works
POST your text and an array of category names. The API uses Claude to classify the text into the best matching category, returning the category name, a confidence score (0–1), and a brief explanation of why it was classified that way.
Use cases
- Route support tickets to the right team (billing/technical/account)
- Tag blog posts or articles with content categories automatically
- Classify customer feedback by product area or feature request type
- Sort job applications into role-fit categories for initial screening
- Categorize transactions by type in financial data processing
API Reference
POST https://slopshop.gg/v1/llm-classify
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text |
string | required | The text to process with AI |
options |
object | optional | Optional configuration (format, length, etc.) |
Example response
{
"data": {
"result": "AI-generated result based on your input.",
"model": "claude-3-5-sonnet",
"tokens_used": 150
},
"meta": {
"credits_used": 10,
"engine": "real",
"ms": 4
}
}
Examples
Three real-world scenarios showing how developers use Text Classify in production.
curl -X POST https://slopshop.gg/v1/llm-classify \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "I was charged twice for my subscription this month.", "categories": ["billing", "technical", "account", "shipping"]}'
curl -X POST https://slopshop.gg/v1/llm-classify \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "New research shows intermittent fasting may reduce inflammation markers...", "categories": ["health", "technology", "finance", "travel", "science"]}'
curl -X POST https://slopshop.gg/v1/llm-classify \
-H "Authorization: Bearer $SLOPSHOP_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "5 years Python, 3 years ML, published papers in NeurIPS...", "categories": ["senior_engineer", "mid_level", "junior", "not_a_fit"]}'
Code examples
curl
curl -X POST https://slopshop.gg/v1/llm-classify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "your data here"}'
Python
import requests
response = requests.post(
"https://slopshop.gg/v1/llm-classify",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"input": "your data here"}
)
result = response.json()
print(result["data"])
Node.js
const response = await fetch("https://slopshop.gg/v1/llm-classify", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);
CLI
# Install the Slopshop CLI
npm install -g slopshop
# Set your API key
export SLOPSHOP_KEY=your_api_key
# Call llm-classify
slop llm-classify '{"input": "your data here"}'
Pricing
Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 10 credits per call — that's $0.01. See all pricing tiers.
Related APIs in AI: Analysis
View the full API catalog · Try in playground · Documentation