{"uid":"cap_cTMO99REAJNp3vDVhGH0F","slug":"x402-deployer-x402-deployer-workers-dev-db865b15","name":"Zero-Shot Text Classifier with Custom Labels","description":"Zero-shot text classifier. Caller supplies labels. Multi-label mode. Calibrated confidences + reasoning.","url":"https://x402-deployer.x402-deployer.workers.dev/classify","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"required":["text","labels"],"properties":{"text":{"type":"string","description":"Text to classify. Max 15k chars."},"labels":{"type":"array","description":"Candidate labels the model picks from. 2-25 items, each a string up to 80 chars."},"multi_label":{"type":"boolean","description":"Boolean, default false. When true, returns every label that applies instead of just the top one."},"label_descriptions":{"type":"object","description":"Optional object mapping each label to a short description to guide classification."}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"top_label":{"type":"string"}}}}}}},"responseSchema":null,"example":{"request":{"input":{"body":{"text":"This movie was absolutely fantastic! The cinematography was stunning and the acting was superb.","labels":["positive","negative","neutral"],"multi_label":false},"type":"http","method":"POST","bodyType":"json"}},"response":{"model":"hermes-3-llama-3.1-405b","labels":["positive","negative","neutral"],"source":"morpheus","results":[{"label":"positive","confidence":0.95}],"reasoning":"The words 'absolutely fantastic','stunning', and'superb' strongly indicate a positive sentiment towards the movie.","top_label":"positive","input_chars":95,"multi_label":false}},"exampleRequest":{"text":"This movie was absolutely fantastic! The cinematography was stunning and the acting was superb.","labels":["positive","negative","neutral"],"multi_label":false},"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":1,"rating":{"score":"0.83","successRate":"0.00","reviews":1,"stars":"4.3","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_U-C8NtXZ45N7r0S5LFtFW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Classifies text into caller-supplied labels using zero-shot inference, supporting multi-label mode with calibrated confidence scores and reasoning.","exampleAgentPrompt":"Classify this customer review into one or more of these labels — 'shipping', 'product quality', 'customer service', 'pricing' — and tell me how confident you are and why: 'The item arrived late and the packaging was damaged, but the refund process was surprisingly smooth.'","exampleUseCases":null,"resultDescription":"Returns a list of labels with calibrated confidence scores (0–1) and a reasoning string explaining why each label was or was not assigned; supports both single-label (argmax) and multi-label output modes.","failureModes":["Empty or missing text input returns a 400 error","No labels supplied results in a 400 validation error","Overly long input text may exceed token limits and return a 413 or truncation error","Ambiguous or highly overlapping labels may produce low-confidence or near-equal scores across all labels","Network timeout on the Cloudflare Worker edge for very large payloads","Payment not included or insufficient USDC results in 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need to classify text into arbitrary, user-defined categories without any prior training data — especially when labels change per request or when multi-label output with confidence scores and reasoning is required. Prefer this over fine-tuned classifiers when flexibility and zero-shot generalization matter more than maximum accuracy on a fixed taxonomy.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":2,"lastUsedAt":"2026-08-20T20:18:10.242Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:52:33.571Z","isFirstParty":false}