{"uid":"cap_WkcxPGHpwhPQyotcOB29V","slug":"text-classification-with-custom-labels-single-or-multi-label-cda08022","name":"Text Classification with Custom Labels (Single or Multi-Label)","description":"Classify text into YOUR labels (single or multi-label) with confidence and reason — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/ai/classify?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"text":{"type":"string","description":"required, up to 12,000 chars"},"labels":{"type":"array","items":{"type":"string"},"maxItems":20,"description":"required: 2-20 labels"},"multi_label":{"type":"boolean","description":"optional"}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"text-classify","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.004,"receipt_id":"g402-<16hex>"},"sources":[{"ok":true,"name":"<source>"}],"limitations":"<text>","generated_at":"<iso time>","evidence_hash":"sha256:<64hex>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lz7rtFOqcx5X8EF5Yetds","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Classifies arbitrary text into user-defined labels with confidence scores and reasoning, supporting both single-label and multi-label classification modes.","exampleAgentPrompt":"Classify this customer review as 'positive', 'negative', or 'neutral' and tell me how confident you are and why: 'The product arrived quickly and works perfectly, but the packaging was a bit flimsy.'","exampleUseCases":[{"title":"Support ticket routing by department","prompt":"I have this incoming support message — classify it as one of: 'billing', 'technical', 'shipping', or 'general inquiry', and tell me how confident you are: 'My order hasn't arrived after 10 days and I can't find a tracking number.'"},{"title":"Multi-label topic tagging for news articles","prompt":"Tag this article with all relevant topics from this list — 'politics', 'economy', 'environment', 'technology', 'health', 'sports' — it can have multiple tags. Here's the text: 'The new federal budget allocates $5B to green energy infrastructure and electric vehicle subsidies.'"},{"title":"Intent detection for chatbot messages","prompt":"Classify this user message into one of these intents: 'cancel_order', 'track_shipment', 'request_refund', 'product_question', 'other'. Message: 'Hey, I changed my mind about my purchase, can I get my money back?'"}],"resultDescription":"Returns the predicted label or labels (in multi-label mode), a confidence score (0–1) for each label, and a natural language reason explaining why the classification was made.","failureModes":["Fewer than 2 or more than 20 labels provided — validation error","Text exceeds 12,000 characters — input too long error","Empty or missing text field — required field error","Ambiguous or overlapping labels may reduce confidence scores","Low-confidence results when text is vague or labels are poorly defined"],"whenToPreferThis":"Choose this endpoint when you need to apply your own custom taxonomy to text rather than relying on a fixed category set. It is especially useful for domain-specific classification tasks (support routing, content tagging, intent detection) where you control the label vocabulary and want both a prediction and a human-readable justification. It supports multi-label output, making it suitable for scenarios where text can belong to more than one category simultaneously.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T01:20:27.589Z","isFirstParty":false,"canonicalSlug":"text-classification-with-custom-labels-single-or-multi-label-cda08022"}