Base URL
Authentication
All requests require a Bearer token in theAuthorization header:
Endpoints
Classification
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/classify | Single-label classification |
| POST | /v1/tag | Multi-label tagging |
Batch
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/classify/batch | Batch single-label classification (up to 1000 texts) |
| POST | /v1/tag/batch | Batch multi-label tagging (up to 1000 texts) |
| POST | /v1/batch | Create async batch job (upload NDJSON, up to 5GB) |
| POST | /v1/batch/{job_id}/start | Start async batch processing |
| GET | /v1/batch | List batch jobs |
| GET | /v1/batch/{job_id} | Poll batch job status |
| GET | /v1/batch/{job_id}/results | Download batch results |
| DELETE | /v1/batch/{job_id} | Delete batch job |
Management
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/classifiers | List saved classifiers |
| POST | /v1/classifiers | Create/save a classifier |
| GET | /v1/classifiers/{name} | Get classifier details |
| GET | /v1/keys | List API keys |
| POST | /v1/keys | Create API key |
| GET | /v1/balance | Get balance and spending |
| GET | /v1/usage | Get usage statistics |
| GET | /v1/logs | Get request logs |
Request format
All endpoints accept JSON withContent-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:
| Field | Type | Description |
|---|---|---|
tokens | number | Total tokens used |
visual_tokens | number | Visual (image) tokens used (only when image provided) |
latency_ms | number | Processing time in milliseconds |
cached | boolean | Whether the response was served from cache |
label, confidence, labels, etc.).
Example response
Response headers
All classification endpoints return these headers:| Header | Description |
|---|---|
X-Request-ID | Unique request identifier |
X-Cache | HIT or MISS |
X-Cache-Key | First 16 characters of cache key |
X-Cache-Age | Seconds since response was cached (cache hits only) |
X-Tokens-Used | Token count for this request (0 for cache hits) |
X-RateLimit-Limit-Requests | Maximum requests per minute |
X-RateLimit-Remaining-Requests | Remaining requests in current window |
X-RateLimit-Limit-Tokens | Maximum tokens per minute |
X-RateLimit-Remaining-Tokens | Remaining tokens in current window |
X-RateLimit-Reset | Unix timestamp when rate limits reset |
Retry-After | Seconds to wait before retrying (429 responses only) |
Error responses
| Field | Type | Description |
|---|---|---|
error | string | Lowercase hyphenated error code |
code | string | Machine-readable error code |
message | string | Human-readable error message |
details | object | Additional context (optional) |
docs_url | string | Link to relevant docs (optional) |
| Status | Description |
|---|---|
400 | Bad request — invalid parameters |
401 | Unauthorized — missing or invalid API key |
402 | Insufficient balance |
409 | Conflict — e.g. batch concurrency limit |
422 | Validation error — check request body |
429 | Rate limit exceeded |
500 | Internal server error |