> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morphllm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reflex API

> Per-turn text classifiers — predict in ~90ms, batch, and train custom Reflexes over an OpenAI-compatible API

## Overview

A Reflex is a small, fast text classifier that puts a label on a turn in \~90ms. Pass a default Reflex name (`jailbreak`, `guardrail`, `leaked-thinking`, `stuck-in-a-loop`, `incomplete-thought`, `user-frustrated`, `ambiguity`, `difficulty`, `domain`) or a model you trained in the `model` field. The playground above is `POST /v1/reflex/predict` — pass `models` (an array) instead of `model` to run several classifiers over one shared prefill.

## Full endpoint surface

Every endpoint below is in the [OpenAPI spec](https://docs.morphllm.com/api-reference/openapi.json). Try `predict` in the playground above; the rest carry copy-paste examples in the guides linked under each table.

### Classify

| Method | Endpoint                                             | Does                                                    |
| ------ | ---------------------------------------------------- | ------------------------------------------------------- |
| `POST` | `/v1/reflex/predict`                                 | Classify text, single or multi-model.                   |
| `POST` | `/v1/reflex/synchronous_predict_batch`               | Up to 300 rows inline, one response.                    |
| `POST` | `/v1/reflex/asynchronous_batches/upload`             | Queue up to 10,000 rows offline at the discounted rate. |
| `GET`  | `/v1/reflex/asynchronous_batches/{batch_id}`         | Poll an async batch.                                    |
| `GET`  | `/v1/reflex/asynchronous_batches/{batch_id}/results` | Fetch async batch results.                              |

Guides: [Predict](/sdk/components/reflexes), [Batch classification](/sdk/components/reflexes/batch).

### Train

| Method   | Endpoint                               | Does                                                                       |
| -------- | -------------------------------------- | -------------------------------------------------------------------------- |
| `POST`   | `/v1/fine_tuning/jobs`                 | Train a custom Reflex from labeled data, a description, or unlabeled text. |
| `GET`    | `/v1/fine_tuning/jobs`                 | List your jobs.                                                            |
| `GET`    | `/v1/fine_tuning/jobs/{job_id}`        | Retrieve a job and poll its status.                                        |
| `POST`   | `/v1/fine_tuning/jobs/{job_id}/cancel` | Cancel a queued or running job.                                            |
| `GET`    | `/v1/fine_tuning/jobs/{job_id}/events` | Training events and the loss curve (SSE with `?stream=true`).              |
| `DELETE` | `/v1/fine_tuning/jobs/{job_id}`        | Delete a job and its model.                                                |
| `DELETE` | `/v1/models/{model}`                   | Delete a trained model by name.                                            |

Guide: [Train a Custom Reflex](/sdk/components/reflexes/custom).

<CardGroup cols={2}>
  <Card title="Reflexes overview" icon="bullseye" href="/sdk/components/reflexes">
    What a Reflex is, the default classifiers, and realtime `/predict`.
  </Card>

  <Card title="Train a Custom Reflex" icon="wrench" href="/sdk/components/reflexes/custom">
    Bring labeled examples or synthesize a dataset; get a classifier in \~30s.
  </Card>
</CardGroup>
