{"uid":"cap_6TnLQavU4oqCz9_e7cheV","slug":"zero-shot-text-classifier-via-llm-01d4dafb","name":"Zero-Shot Text Classifier via LLM","description":"Generate an AI_POLICY.md and a pull request template with an AI-disclosure section for your open-source repo. Free, runs in your browser.","url":"https://ai-policy-kit.moneymaker-ai.workers.dev/api/ai/classify?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["text","labels"],"properties":{"text":{"type":"string","description":"text to label, max 8,000 characters"},"labels":{"type":"array","items":{"type":"string"},"description":"2-50 labels (JSON array or comma-separated string)"},"multi_label":{"enum":["true","false"],"type":"string"},"instructions":{"type":"string","description":"optional labelling guidance"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"note":"Zero-shot LLM label; no calibrated probability. Validate on a sample of your own data before relying on it.","label":"billing","engine":"@cf/ibm-granite/granite-4.0-h-micro on Cloudflare Workers AI","reason":"The text discusses an issue with a payment being charged twice for the same order, which falls under the billing category.","multi_label":false,"allowed_labels":["billing","shipping","technical","account","other"],"neurons_estimated":0.52}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xCEH9-Fn0132dTX3lJQ0E","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Classifies a text snippet into one of your provided labels using zero-shot LLM inference powered by IBM Granite on Cloudflare Workers AI","exampleAgentPrompt":"Classify this support message into one of these categories — billing, shipping, technical, account, or other — and explain why: 'I was charged twice for my order last Tuesday and still haven't received a refund.'","exampleUseCases":[{"title":"Customer support ticket triage","prompt":"Take this incoming support ticket and classify it as billing, shipping, technical, account, or other so I know which team to route it to: 'My package was marked delivered but I never received it.'"},{"title":"Feedback theme labeling","prompt":"I have this piece of user feedback: 'The login page keeps crashing on mobile.' Label it as one of these categories — bug, feature-request, performance, UX, or other — and tell me why you chose that label."},{"title":"Content moderation routing","prompt":"Classify this user-submitted comment as safe, spam, hate-speech, or off-topic, and tell me your reasoning: 'Click here to win a free iPhone — limited time offer!!!'"}],"resultDescription":"Returns a JSON object with the predicted label, a human-readable reason for the classification, the LLM engine used, the list of allowed labels, whether multi-label mode was active, an estimated neuron cost, and a disclaimer that the score is a zero-shot LLM output without calibrated probability.","failureModes":["Too few or too many labels (outside 2-50 range) returns a validation error","Text exceeding 8,000 characters may be truncated or rejected","Ambiguous text with no clear label match may produce unreliable or low-confidence results","Payment not attached or insufficient USDC (0.002) results in 402 response","Labels array malformed (not valid JSON array or comma-separated) causes a parse error","Network timeout on Cloudflare Workers AI backend returns 5xx"],"whenToPreferThis":"Choose this endpoint when you need lightweight, zero-shot text classification against a custom label set without training a model. It is ideal for routing support tickets, labeling feedback, or tagging content in real time when you already know your label taxonomy. Prefer it over fine-tuned classifiers when speed of setup matters more than calibrated probability scores, and over general LLM chat calls when you want a structured JSON response with the label and reasoning included.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-28T06:38:37.042Z","isFirstParty":false,"canonicalSlug":"zero-shot-text-classifier-via-llm-01d4dafb"}