
model field of your request.
| Reflex | model | Classes | What it catches |
|---|---|---|---|
| Jailbreak | jailbreak | benign / jailbreak | Prompt-injection and jailbreak attempts. |
| Guardrail | guardrail | true / false | Harassment or NSFW content in a message. |
| Leaked Thinking | leaked-thinking | clean / leaked | Agent leaking internal thinking or instructions. |
| Stuck-in-a-loop | stuck-in-a-loop | progressing / looping | Agent blocked and not trying new things. |
| Incomplete Thought | incomplete-thought | complete / incomplete | User sent an incomplete prompt or instruction. |
| User Frustration | user-frustrated | frustrated / not frustrated | The user is frustrated with the agent. |
| Ambiguity | ambiguity | low / med / high | How vague or underspecified a prompt is. |
| Difficulty | difficulty | easy / medium / hard | How hard a prompt is, for routing simple vs complex models. |
| Domain | domain | general / summary / coding / design / data | The topic or domain of a request. Multi-label. |
Getting Started
Open the Reflex dashboard
Test any Reflex, browse your custom-trained ones, and watch live training stats. You can also train a Reflex from a description in the agent chat — “Vibecode a Reflex”.
Run evals automatically on your traces
Pass
evals on a begin() turn and Morph labels it for you, async and off your request path — results land in the Traces dashboard and the export.Send your text
POST /v1/reflex/predict with the text you want classified. Max input is 65,536 tokens.The response
Every Reflex returns the same shape:| Field | Type | Meaning |
|---|---|---|
model | string | The Reflex you called. |
mode | single_label / multi_label | How scores are computed. |
classes | array | One entry per class, in class_id order. |
classes[].label | string | The class name. |
classes[].score | number | Confidence for that class, 0–1. |
classes[].selected | boolean | Whether the server picked this class. |
inference_time_ms | number | Server-side classification time only. End-to-end is ~90ms including network. |
prefill_tokens | number | Tokenized input length, charged once per request. |
"selected": true, never a separate field.
To run several Reflexes over one text in a single request, pass models (an array) instead of model — see Classify against multiple models.
- single_label (every default Reflex except
domain): scores are a softmax that sums to 1. At most one class is selected, the highest scorer above its threshold. - multi_label (e.g.
domain): scores are independent, each 0–1 with no sum constraint. Zero or more classes can be selected.
Use it in your agent loop
The point of a label is to act on it. Checkselected, then gate, route, or alert:
difficulty, branch on domain, or alert when stuck-in-a-loop flips to looping.
Errors
Failed requests return a non-2xx status with an OpenAI-shapederror object:
model or text field (400), an invalid API key (401), a model name that doesn’t exist (404 model_not_found), or a model that hasn’t finished training (409 model_not_ready). Get a key from your dashboard.
Pricing
Reflexes are priced per event, where one classification is one event. Realtime calls hit/v1/reflex/predict and return in around 90ms. The async batch API (/v1/reflex/asynchronous_batches) trades latency for cost: submit events offline and pick up results when the job finishes. Rates step down once you pass 1M events in a billing month.
| Mode | Under 1M events | Over 1M events |
|---|---|---|
| Realtime | $0.0005/event | $0.00025/event |
| Async batch | $0.00003/event | $0.00001/event |
Train a Custom Reflex
When the defaults don’t match your categories, train your own in one API call. Bring labeled examples, let Morph synthesize a dataset from a description, or hand it unlabeled text to sort. A small Reflex trains in about 30 seconds. Prefer to do it from a UI? Open the Reflex dashboard to train from a description in the agent chat (“Vibecode a Reflex”), then test your model and follow live training stats there.Train a Custom Reflex
Send labeled examples, get a trained classifier. Full API: create, poll, predict, manage jobs.
Batch classification
Classify up to 300 rows inline, or 10,000 offline. Sync and async batch APIs.