labelf.ai
Book a Demo
API Documentation
https://api.labelf.ai/v2 REST + JSON Bearer Auth
POST /v2/models/{model_id}/inference

Classification

Classify one or more texts against a deployed model. Returns labels sorted by confidence. Up to 8 texts per request, any language, sub-50ms typical latency. This is the core endpoint that powers everything from real-time call tagging to overnight batch classification of millions of interactions.

Request Body

Parameter Type Description
texts string[] Required Texts to classify. Max 8 per request. Each text can be up to 10,000 characters.
max_predictions integer Max labels to return per text. Omit to return all labels with their scores. Set to 1 for top-match only.
label_filter string[] Only return scores for these specific labels. Useful when you only care about a subset of the model's labels (e.g. churn-related categories).

Response

Returns an array of predictions for each input text, sorted by confidence descending. Each prediction includes the label name and a score between 0 and 1. The response also includes the detected language and processing time.

Field Type Description
predictions object[][] Outer array maps 1:1 to input texts. Inner array contains label/confidence pairs, sorted by confidence descending.
model_id integer The model used for classification.
text_language string Detected ISO 639-1 language code of the input text.
processing_time_ms integer Server-side processing time in milliseconds. Typically 20–50ms.

Classification Levels

The same endpoint classifies at any level of granularity. The difference is what you pass as text — a single customer message, a full conversation transcript, or an aggregated case history.

Utterance Level

Classify a single customer message. This is the highest-resolution classification — identify the exact moment a customer mentions a specific issue.

Request
curl -X POST https://api.labelf.ai/v2/models/42/inference \
  -H "Authorization: Bearer $LABELF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"texts": ["I can'\''t log in to my account"]}'
Response
{
  "predictions": [[
    { "label": "Login Issue", "confidence": 0.96 },
    { "label": "Account Access", "confidence": 0.02 },
    { "label": "Password Reset", "confidence": 0.01 }
  ]],
  "model_id": 42,
  "text_language": "en",
  "processing_time_ms": 31
}

Conversation Level

Pass the entire conversation transcript as a single text. The model classifies the overall intent and outcome of the interaction.

Request — full transcript
{
  "texts": [
    "Agent: Thank you for calling, how can I help?\nCustomer: Hi, I've been having issues with my broadband for a week now. It keeps dropping out every evening.\nAgent: I'm sorry to hear that. Let me check your connection...\nCustomer: I've already called twice about this. If it's not fixed I'm switching to another provider.\nAgent: I understand your frustration. Let me escalate this to our network team..."
  ],
  "max_predictions": 3
}
Response
{
  "predictions": [[
    { "label": "Technical Issue - Broadband", "confidence": 0.91 },
    { "label": "Churn Risk", "confidence": 0.87 },
    { "label": "Repeat Contact", "confidence": 0.79 }
  ]],
  "model_id": 42,
  "text_language": "en",
  "processing_time_ms": 44
}

Using max_predictions

Control how many labels are returned per text. Set to 1 when you only need the top match for routing. Omit to get the full confidence distribution across all labels — useful for analytics and dashboard visualization.

Using label_filter

When you only care about specific outcomes, use label_filter to restrict the response. This is common in churn monitoring: you want to know if a conversation is about cancellation, not what else it might be about.

Request — filter to churn-related labels
{
  "texts": ["I want to switch to a competitor"],
  "label_filter": ["Cancellation", "Churn Risk", "Competitor Mention"]
}
Response
{
  "predictions": [[
    { "label": "Competitor Mention", "confidence": 0.93 },
    { "label": "Churn Risk", "confidence": 0.88 },
    { "label": "Cancellation", "confidence": 0.71 }
  ]],
  "model_id": 42,
  "text_language": "en",
  "processing_time_ms": 29
}

Hierarchical Classification

Real contact center analytics requires multiple classification dimensions. A single interaction often needs to be tagged with a product, an issue type, and a root cause. Labelf handles this by running multiple specialized models in sequence — or in parallel via the Multi-Model endpoint.

A typical hierarchy for a telecom:

1

Product Model

Mobile, Broadband, TV, Fixed Line, Bundled

2

Issue Type Model

Billing, Technical, Delivery, Cancellation, Upgrade

3

Root Cause Model

Wrong charge, Payment failed, Invoice unclear, Coverage issue, Speed complaint

Each model is trained independently on its own label set. You can call them individually or use the multi-model endpoint to run all three in a single request:

Multi-model request — single call, three models
POST /v2/multi-model/inference

{
  "model_ids": [42, 43, 44],
  "texts": ["I was charged twice for my mobile bill last month"],
  "max_predictions": 1
}
Response
{
  "results": {
    "42": { "predictions": [[{ "label": "Mobile", "confidence": 0.97 }]] },
    "43": { "predictions": [[{ "label": "Billing", "confidence": 0.95 }]] },
    "44": { "predictions": [[{ "label": "Wrong charge", "confidence": 0.91 }]] }
  },
  "processing_time_ms": 52
}

Confidence Thresholds

Every prediction includes a confidence score between 0 and 1. How you use that score depends on the cost of getting it wrong. Here is a typical strategy used by enterprise customers:

>0.9

High confidence

Auto-tag and route. Feed directly into your CRM, ticketing system, or real-time dashboard. No human review needed.

0.7–0.9

Medium confidence

Tag but flag for review. The classification is likely correct, but a human should verify before triggering high-stakes actions (e.g. retention offers).

<0.7

Low confidence

Route to a human for manual classification. These uncertain predictions become training data — this is how customers bootstrap and continuously improve their models.

This pattern creates a virtuous cycle: the model handles the easy cases, humans handle the edge cases, and the edge cases become training data that makes the model better. Over time, the low-confidence bucket shrinks as the model learns from your specific data.

Multi-Language Classification

Labelf's models are multilingual by default. The same endpoint handles 100+ languages — no language parameter needed, no separate models per language. Train on English, classify in Swedish, Arabic, or Japanese. Labels are always returned in the language they were defined during training.

Swedish
{
  "texts": ["Jag vill säga upp mitt abonnemang"]
}
Response
{ "label": "Cancellation", "confidence": 0.92 }
"text_language": "sv"
Arabic
{
  "texts": ["أريد إلغاء اشتراكي"]
}
Response
{ "label": "Cancellation", "confidence": 0.89 }
"text_language": "ar"
Japanese
{
  "texts": ["サブスクリプションを解約したいです"]
}
Response
{ "label": "Cancellation", "confidence": 0.87 }
"text_language": "ja"

All three requests return the same English label Cancellation despite being in different languages. No language parameter, no per-language model, no configuration. This is particularly valuable for multinational operators or contact centers that handle multiple markets from a single platform.

Full Example

Classify two texts, return top 3 predictions
POST /v2/models/42/inference
Authorization: Bearer your-api-key
Content-Type: application/json

{
  "texts": [
    "I want to cancel my subscription",
    "How do I update my payment method?"
  ],
  "max_predictions": 3
}
Response
{
  "predictions": [
    [
      { "label": "Cancellation", "confidence": 0.94 },
      { "label": "Billing Issue", "confidence": 0.03 },
      { "label": "Technical Support", "confidence": 0.02 }
    ],
    [
      { "label": "Billing Issue", "confidence": 0.91 },
      { "label": "Account Management", "confidence": 0.05 },
      { "label": "Technical Support", "confidence": 0.02 }
    ]
  ],
  "model_id": 42,
  "text_language": "en",
  "processing_time_ms": 38
}
labelf.ai
Address:
Gamla Brogatan 26, Stockholm, Sweden
Contact:

© 2026 Labelf. All rights reserved.