---
title: "Classify a batch inline"
method: POST
path: "/v1/reflex/synchronous_predict_batch"
tags: ["reflex"]
---

# Classify a batch inline

`POST /v1/reflex/synchronous_predict_batch`

Send up to 300 rows and get every label back in the same response. Runs on the realtime engine (realtime rate), with internal concurrency so it returns in seconds. Each row carries its own `id` (echoed back) and one or many model names. Naming a model that doesn’t exist fails the whole request; a row that fails validation comes back with `error` while the others return.

## Request body

- ReflexSyncBatchRequest — Inline batch of rows classified on the realtime engine.
  - `requests` object[], required — Up to 300 rows.
    - `id` string, required — Your correlation key, echoed back on each result.
    - `model` union, required — One model name, or an array to run several over the same `text`.
      - string — A single Reflex name.
      - string[] — Several Reflex names to run over this row.
    - `text` string, required — The text to classify for this row.

## Response `200`

Per-row results.

- ReflexSyncBatchResponse — Per-row results for an inline batch.
  - `results` object[], required — One entry per row. A completed row carries `predictions` (one per model) and `prefill_tokens`; a validation-failed row carries `error` instead.
    - `id` string, required — The correlation key you sent for this row.
    - `predictions` ReflexPrediction[] — One prediction per model named on the row.
      - `model` string, required — The Reflex that produced this result.
      - `mode` 'single_label' | 'multi_label', required — `single_label` scores are a softmax summing to 1 (at most one selected); `multi_label` scores are independent 0–1 (zero or more selected).
      - `classes` ReflexClass[] — Every class this Reflex scores, ordered by class index.
        - `class_id` integer, required — Stable index of the class.
        - `label` string, required — The class name.
        - `score` number, required — Confidence for this class, 0–1.
        - `selected` boolean, required — Whether the server picked this class (top scorer above its threshold). A Reflex can select nothing.
      - `error` string — Present instead of `classes` when this model failed.
    - `prefill_tokens` integer — Tokenized length of this row, charged once however many models ran.
    - `error` object — Why this row failed validation, when it did.
      - `type` string, required — Machine-readable reason the row was rejected.
      - `message` string, required — What went wrong for this specific row.

## Other responses

- `400` — Malformed request — missing or invalid fields.
- `401` — Missing or invalid API key.
- `429` — Rate limited — retry after the interval in the Retry-After header.
- `500` — Internal error — safe to retry with backoff.

---

[API](https://skmtc.dev/morphllm/apis/morph-api.md) · [All operations](https://skmtc.dev/morphllm/apis/morph-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/morphllm/morph-api/revisions/b9a74274b2ab/schema)
