Skip to main content

Overview

The extract, summarize, and classify operations are available through a standard OpenAI-compatible POST /v1/chat/completions endpoint. Select the operation with the model field — exactly as the Batch API does. This lets you point an unmodified OpenAI (or OpenRouter) SDK client at ScaleDown. The structured result is returned as a JSON string in choices[0].message.content — parse it to get the same object the realtime /extract, /classify, and /summarization/abstractive endpoints return. Request headers

List models

GET /v1/models

Returns the catalog of ScaleDown operations in the OpenAI list format (with additional OpenRouter provider metadata that plain OpenAI clients ignore).

"model": "summarize"

Fully standard chat: the system message carries optional instructions, the last user message carries the text.
max_tokens is honored as the standard OpenAI field.

"model": "extract"

Define the fields to extract with the standard response_format JSON schema; each property name becomes an entity type and its description is the extraction hint. Nested objects and arrays are supported. The text comes from the last user message.
The parsed message.content matches the /extract response ({"entities": [...], "structured_result": {...}, "input_tokens": ...}).

Classification within extract

extract can also classify a field against a fixed set of labels in the same call (the same behavior as the realtime /extract endpoint). Express a classification field as a constrained-choice property:
  • enum — the values are the labels; an optional description becomes the shared rubric.
  • oneOf of const branches — each branch’s description is that label’s rubric (per-label rubrics).
Plain properties (product) are extracted; constrained properties (sentiment, priority) are classified and returned in the extract response’s structured_result. Alternatively, send the classification config through the flat entities body: {"sentiment": {"labels": [{"name": ..., "rubric": ...}]}}.

"model": "classify"

Classification needs a per-label rubric (decision guidance that drives the calibrated scoring), which has no native slot in the OpenAI chat schema. Supply labels as an array of {name, rubric} via the SDK’s extra_body. The text comes from the last user message; an optional system_prompt may be passed the same way.
Provide between 2 and 26 labels. The parsed message.content matches the /classify response (top_label, scores, labels, reasoning, input_tokens).

Flat body (batch parity)

For every operation you may instead send the domain fields as top-level keys — the same shape as a batch item body — and they take precedence over the message/response_format carriers:
This makes a batch item body usable verbatim against the synchronous endpoint.

Response shape

All three operations return a standard chat.completion:
model echoes the operation name; usage.prompt_tokens carries the operation’s input_tokens.