---
title: "Upload an async batch"
method: POST
path: "/v1/reflex/asynchronous_batches/upload"
tags: ["Reflex"]
---

# Upload an async batch

`POST /v1/reflex/asynchronous_batches/upload`

Queue up to 10,000 rows for offline classification at the discounted batch rate. Returns immediately with a `batch_id` once the rows are queued — it does not wait for classification. `model` must be an array here, even for one model. Pass an `Idempotency-Key` header to make retries safe (a replay returns the existing batch with `200`).

## Headers

- `Idempotency-Key` string

## Request body

- ReflexAsyncBatchUploadRequest
  - `requests` object[], required — Up to 10,000 rows.
    - `id` string, required — Unique within the batch. Echoed back on each result.
    - `model` string[], required — One or more model names. Always an array on the async endpoint, even for one model.
    - `text` string, required — The text to classify. Up to 350,000 characters.

## Response `200`

Existing batch returned for a replayed `Idempotency-Key`.

- ReflexBatch — Async batch status. `status` moves `queued → in_progress → completed`.
  - `id` string
  - `object` string
  - `status` 'queued' | 'in_progress' | 'completed'
  - `request_counts` object
    - `total` integer
    - `completed` integer
    - `failed` integer
  - `created_at` integer — Unix timestamp (seconds).

## Other responses

- `201` — Batch queued.
- `400` — Validation failed — duplicate `id`, `text` over 350k chars, `model` not an array, or more than 10,000 rows.
- `401` — Invalid or missing API key.
- `404` — `model_not_found` — a named model doesn't exist.
- `409` — `model_not_ready` — a named model hasn't finished training.

---

[API](https://skmtc.net/morphllm/apis/morph-api.md) · [All operations](https://skmtc.net/morphllm/apis/morph-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/morphllm/morph-api/versions/9e3d888071b5/schema)
