Prebuilt Classification Functions
The fastest way to start using Nyckel is to call a function someone else has already built. Nyckel hosts dozens of prebuilt classification functions for common tasks — content moderation, sentiment, NSFW detection, document type, language identification, and more.
You don’t define labels, you don’t upload training data, you don’t wait for a model to train. You pick a function, you invoke it. Most prebuilt functions return useful results in under a second.
Time: 3–5 minutes from sign-in to first API call.
1. Pick a function
Browse the catalog at /pretrained-classifiers/. Each prebuilt function has its own page with:
- A description of what it classifies
- The list of labels it returns
- A drag-and-drop box where you can try the function on your own input
Pick one that matches what you want to do. Some popular starting points:
- NSFW Image Classifier — flag explicit images.
- Sentiment Classifier — positive, negative, or neutral text.
- Language Detector — identify what language a piece of text is in.
- Document Type Classifier — recognize invoices, receipts, contracts, etc.
If nothing in the catalog fits, you’ll need to create your own classification function instead.
2. Try it in the browser
Use the drag-and-drop box on the function’s page to test it on your own input — drop in an image or paste in text and you’ll see the predicted label and confidence right there. This is the moment to sanity-check whether the function actually fits your use case. Some questions worth asking:
- Are the labels the function returns the labels you care about? (If a content moderation function returns
safe/nsfwbut you need three tiers, you’ll want your own function.) - Does the function’s confidence behave the way you expect on borderline cases? If it’s a little soft on the inputs you care about, add the function to your account and review and correct a handful of predictions — even a small amount of feedback on your own data noticeably tightens the model’s confidence.
- For images, does it handle the kinds of photos your application sends?
If it looks like a good start, you’re ready to add it to your account. If not, create your own function instead.
3. Add it to your account
- Create a Nyckel account (or sign in to an existing one).
- From the prebuilt function’s page, add it to your own list of functions. It then shows up in your console like any function you built yourself.
- Open the function in the console and click Integrate to get the endpoint URL, an access token, and code snippets in your language.
4. Call it from your application
The request shape is the same as for any Nyckel function:
POST https://www.nyckel.com/v1/functions/{functionId}/invoke
Authorization: Bearer {your_access_token}
Content-Type: application/json
{
"data": "I love this product, it's amazing!"
}
Response:
{
"labelName": "Positive",
"confidence": 0.96,
"sampleId": "smp_xyz789"
}
Read labelName to route the input and confidence to decide whether to act automatically or hold the prediction for human review. The Tuning Confidence Thresholds guide covers how to pick that cutoff for your application.
5. What if it’s not quite right?
Two common situations:
The labels don’t match what you need. Create your own function with the labels you actually use — see Create Your Own Classification Function.
The labels match but accuracy is off on your data. You can clone a prebuilt function into your account and add your own training samples on top of it. The function keeps the prebuilt knowledge and adapts to your specific data distribution.
Next
- Create Your Own Classification Function — if no prebuilt function fits.
- Tuning Confidence Thresholds — how to use the confidence score in your application.