Classification
Label text against your own labels in one call — ticket triage, moderation, lead scoring.
POST /v1/classify assigns your labels to text — support-ticket triage,
content moderation, lead qualification, intent detection — without prompt
engineering. The gateway builds a strict schema from your labels, so the
model can only ever answer with one of them (out-of-label answers are
caught and retried server-side).
curl https://api.gopuram.net/v1/classify \
-H "Authorization: Bearer $GOPURAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "my card was charged twice this month and I want it fixed",
"labels": ["billing", "technical-support", "sales", "feedback"]
}'
{
"object": "classification",
"model": "google/gemini-3.6-flash",
"label": "billing",
"confidence": 0.92,
"usage": { "cost": 0.00021, "steps": [ … ] }
}
Request
| Field | Type | Notes |
|---|---|---|
input | string | up to 100k characters |
labels | string[] | 2–50 unique labels, ≤200 chars each |
multi_label | boolean | true → returns labels: [{label, confidence}, …], every label the model asserts, sorted by confidence |
model | string | optional structured-output chat model override |
About confidence: it is the model's self-estimate, useful as an
ordinal signal (0.9 beats 0.5) but not a calibrated probability — our
upstreams don't expose token logprobs uniformly across 250+ models, and we
won't dress up a guess as statistics. For routing decisions, thresholding
at ~0.7 works well in practice; for anything regulatory, keep a human in
the loop.
Batching: send one request per item — requests are cheap (a classification costs fractions of a cent) and parallelize cleanly client-side.