Prediction Endpoints
A Nyckel prediction endpoint is a REST API endpoint that accepts an input and returns a prediction with a confidence score. Each function (model) you create in Nyckel gets its own endpoint.
Invoke URL structure
POST https://www.nyckel.com/v1/functions/{functionId}/invoke
The functionId is found in the Nyckel console on your function’s details page.
Request format
Send the input as a JSON body with a data field.
Text input:
POST /v1/functions/{functionId}/invoke
Authorization: Bearer {token}
Content-Type: application/json
{ "data": "My subscription was cancelled without notice." }
Image input (URL):
POST /v1/functions/{functionId}/invoke
Authorization: Bearer {token}
Content-Type: application/json
{ "data": "https://example.com/photo.jpg" }
Tabular input:
POST /v1/functions/{functionId}/invoke
Authorization: Bearer {token}
Content-Type: application/json
{
"data": {
"age": 34,
"plan": "pro",
"logins_last_30d": 2
}
}
Response format
Every invoke response includes labelName and confidence:
{
"sampleId": "smp_abc123",
"labelName": "Churn risk",
"confidence": 0.88
}
The sampleId is important — store it if you plan to submit feedback later. See Build a feedback loop.
HTTP status codes
| Code | Meaning |
|---|---|
200 |
Prediction returned successfully |
401 |
Missing or invalid access token |
404 |
Function ID not found |
429 |
Rate limit exceeded — back off and retry |
5xx |
Server error — retry with exponential backoff |
Nyckel does not store image data beyond what is needed for training. See the Privacy Policy for details.