POST /api/classify

Classify Text

Categorize text into predefined or custom categories. Default categories include technology, business, politics, science, health, entertainment, and sports.

$0.02 per request

> REQUEST

POST /api/classify

{
  "text": "The latest smartphone features a 6.7-inch OLED display, 5G connectivity...",
  "options": {
    "categories": ["technology", "business", "lifestyle"],
    "explanation": true
  }
}

> RESPONSE

{
  "result": {
    "category": "technology",
    "confidence": 0.94,
    "explanation": "Text describes smartphone specifications",
    "all_categories": ["technology", "business", "lifestyle"]
  },
  "tokens_used": { "prompt_tokens": 76, "completion_tokens": 38, "total_tokens": 114 }
}