Skip to main content

Base URL

https://api.classer.ai

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer your-api-key
See Authentication for details.

Endpoints

Classification

MethodEndpointDescription
POST/v1/classifySingle-label classification
POST/v1/tagMulti-label tagging

Batch

MethodEndpointDescription
POST/v1/classify/batchBatch single-label classification (up to 1000 texts)
POST/v1/tag/batchBatch multi-label tagging (up to 1000 texts)
POST/v1/batchCreate async batch job (upload NDJSON, up to 5GB)
POST/v1/batch/{job_id}/startStart async batch processing
GET/v1/batchList batch jobs
GET/v1/batch/{job_id}Poll batch job status
GET/v1/batch/{job_id}/resultsDownload batch results
DELETE/v1/batch/{job_id}Delete batch job

Management

MethodEndpointDescription
GET/v1/classifiersList saved classifiers
POST/v1/classifiersCreate/save a classifier
GET/v1/classifiers/{name}Get classifier details
GET/v1/keysList API keys
POST/v1/keysCreate API key
GET/v1/balanceGet balance and spending
GET/v1/usageGet usage statistics
GET/v1/logsGet request logs

Request format

All endpoints accept JSON with Content-Type: application/json. Maximum request body size is 1MB for real-time endpoints.

File inputs

The /v1/classify and /v1/tag endpoints accept a file field for PDF and DOCX documents. The API extracts text and converts each page to an image, then classifies using both the text content and visual layout. Max 20 pages.

Response format

Classification responses (/v1/classify, /v1/tag) include:
FieldTypeDescription
tokensnumberTotal tokens used
visual_tokensnumberVisual (image) tokens used (only when image provided)
latency_msnumberProcessing time in milliseconds
cachedbooleanWhether the response was served from cache
Plus endpoint-specific fields (label, confidence, labels, etc.).

Example response

{
  "label": "technical",
  "confidence": 0.9423,
  "tokens": 142,
  "latency_ms": 87,
  "cached": false
}

Response headers

All classification endpoints return these headers:
HeaderDescription
X-Request-IDUnique request identifier
X-CacheHIT or MISS
X-Cache-KeyFirst 16 characters of cache key
X-Cache-AgeSeconds since response was cached (cache hits only)
X-Tokens-UsedToken count for this request (0 for cache hits)
X-RateLimit-Limit-RequestsMaximum requests per minute
X-RateLimit-Remaining-RequestsRemaining requests in current window
X-RateLimit-Limit-TokensMaximum tokens per minute
X-RateLimit-Remaining-TokensRemaining tokens in current window
X-RateLimit-ResetUnix timestamp when rate limits reset
Retry-AfterSeconds to wait before retrying (429 responses only)

Error responses

{
  "error": "validation-error",
  "code": "VALIDATION_ERROR",
  "message": "Labels must be unique",
  "details": { "field": "labels" },
  "docs_url": "https://docs.classer.ai/api-reference/classify"
}
FieldTypeDescription
errorstringLowercase hyphenated error code
codestringMachine-readable error code
messagestringHuman-readable error message
detailsobjectAdditional context (optional)
docs_urlstringLink to relevant docs (optional)
StatusDescription
400Bad request — invalid parameters
401Unauthorized — missing or invalid API key
402Insufficient balance
409Conflict — e.g. batch concurrency limit
422Validation error — check request body
429Rate limit exceeded
500Internal server error

Pricing, priority levels & limits

See Pricing & Limits for full details on priority levels, rate limits, free tier, and validation limits.