Skip to content
AnswerWell geo Documentation

Research · 6 min read · Answerwell

Model API Schemas: Synchronous, Streaming, and Batch Inference

How Cloudflare Workers AI catalog models expose Synchronous, Streaming, and Batch API schemas, and which model families support each pattern.

This page summarises Cloudflare Workers AI and the parallel Cloudflare AI model catalog entries for hosted models. Both surfaces document the same logical contract: named API schemas that describe how you send input and read output for a given model. The cluster of model pages does not repeat full OpenAPI field lists here; it consistently labels which invocation modes each model supports.

API schemas: what the catalog is telling you

Section titled “API schemas: what the catalog is telling you”

An API schema on a model page is the documentation’s name for a request–response shape tied to an invocation mode. Pages list raw schema identifiers such as SynchronousInput, SynchronousOutput, StreamingInput, StreamingOutput, BatchInput, and BatchOutput. Those names are the stable signal for whether you can call the model once and wait for a full result, stream partial output, or submit batch work.

On embedding and many smaller utility models, the published raw schema set is:

SynchronousInput
SynchronousOutput
BatchInput
BatchOutput

— Cloudflare, bge-base-en-v1.5 (Workers AI)

The same four names appear on the matching catalog URL for that model:

SynchronousInput
SynchronousOutput
BatchInput
BatchOutput

— Cloudflare, bge-base-en-v1.5 (AI models)

Common conclusion: treat the schema list on the model’s page as the authoritative checklist of supported invocation modes. If StreamingInput and StreamingOutput are absent, the published contract for that model is synchronous and batch only—not an undocumented streaming endpoint.

Synchronous inference: one request, one completed result

Section titled “Synchronous inference: one request, one completed result”

Synchronous schemas (SynchronousInput / SynchronousOutput) mean a single logical call: you supply input formatted to SynchronousInput and receive a complete payload described by SynchronousOutput. This pattern appears on every model in this documentation set, including embeddings, chat-style LLMs, and translation models.

Typical uses include low-latency lookups, short prompts, embedding a bounded amount of text, or any workflow where your caller can wait for the full result before continuing.

All BGE embedding variants in the cluster publish only synchronous and batch schemas—for example bge-small-en-v1.5, bge-large-en-v1.5, and bge-m3—each with the four-schema pattern quoted above.

Streaming inference: incremental output schemas

Section titled “Streaming inference: incremental output schemas”

Streaming schemas (StreamingInput / StreamingOutput) indicate that the documented contract includes a streaming invocation path in addition to synchronous and batch modes. In the cluster, streaming schemas appear on generative and instruction-tuned LLMs, not on the BGE embedding family or on m2m100-1.2b translation.

A representative LLM listing is:

SynchronousInput
SynchronousOutput
StreamingInput
StreamingOutput
BatchInput
BatchOutput

— Cloudflare, deepseek-v4-flash-0731 (Workers AI)

The same six names are listed on deepseek-v4-flash-0731 (AI models).

Other models in the cluster with the same six-schema pattern include deepseek-v4-pro-0813, deepseek-v4.1-flash-1017, gemma-4-26b-a4b-it, gemma-sea-lion-v4-27b-it, glm-5.2, glm-5.3, glm-5.3-flash, gpt-oss-120b, gpt-oss-20b, kimi-k2.6, kimi-k2.7-code, llama-3.3-70b-instruct-fp8-fast, llama-4-scout-17b-16e-instruct, qwen3-30b-a3b-fp8, and qwen3.8-27b.

Choose streaming when your application must render partial tokens, flush progress to a client, or avoid holding a long-lived HTTP connection open until the entire completion is materialised in one body—as long as the target model’s page lists streaming schemas.

Batch inference: separate input and output schemas

Section titled “Batch inference: separate input and output schemas”

Batch schemas (BatchInput / BatchOutput) are documented alongside synchronous modes on every model in this cluster, including embeddings, LLMs, and m2m100-1.2b. Translation documents the same quartet as BGE (no streaming):

SynchronousInput
SynchronousOutput
BatchInput
BatchOutput

— Cloudflare, m2m100-1.2b (Workers AI)

Batch is appropriate when work can be grouped, tolerates higher latency per unit, or should not compete with interactive synchronous traffic—provided your integration uses the batch-shaped schemas rather than assuming a synchronous envelope.

Workers AI model pages vs AI catalog (@cf) pages

Section titled “Workers AI model pages vs AI catalog (@cf) pages”

Each model in the cluster appears twice: under workers-ai/models/… and under ai/models/@cf/…. For the models sampled here, the API Schemas (Raw) section lists the same schema identifiers on both URLs.

Model example Workers AI URL AI catalog URL Schemas listed
bge-base-en-v1.5 workers-ai/models/bge-base-en-v1.5 ai/models/@cf/baai/bge-base-en-v1.5 Sync + Batch (4)
deepseek-v4-flash-0731 workers-ai/models/deepseek-v4-flash-0731 ai/models/@cf/deepseek-ai/deepseek-v4-flash-0731 Sync + Stream + Batch (6)
m2m100-1.2b workers-ai/models/m2m100-1.2b ai/models/@cf/meta/m2m100-1.2b Sync + Batch (4)

Pick one canonical page per model in your internal docs; if schema lists ever diverge, treat the model-specific page you call in production as the source of truth and re-check the paired URL.

Embeddings (BGE)

Sync + Batch on bge-m3 and related variants.

Translation

Sync + Batch on m2m100-1.2b only in this set.
Your goal Look for on the model page Example in this cluster
Vectorise or score text with embeddings SynchronousInput / SynchronousOutput; optional Batch* bge-large-en-v1.5
Chat or completion with token-by-token UX Above plus StreamingInput / StreamingOutput glm-5.3-flash
Offline or bulk generation / embedding BatchInput / BatchOutput (with sync often still available) Any listed LLM or bge-small-en-v1.5
Machine translation without streaming Sync + Batch only m2m100-1.2b
  • Using synchronous JSON shapes for batch jobs — batch has distinct BatchInput and BatchOutput documentation; mixing them with synchronous calls produces validation or runtime errors even when the underlying weights are the same model.
  • Enabling streaming against a four-schema model — BGE and m2m100-1.2b pages do not publish streaming schemas; a streaming client path is not part of the documented contract for those entries.
  • Copying schema names from a different model family — kimi-k2.7-code and bge-m3 both live on Workers AI, but only the former documents streaming schemas in this cluster.
  • Ignoring the paired catalog URL — integrations that bookmark only @cf paths should still verify schema parity with the Workers AI twin before rollout.
Section titled “Related Cloudflare AI docs outside this schema list”

Other pages in the same broad documentation tree cover different layers: JSON configuration for AI Gateway dynamic routing describes composable routing elements (“Dynamic routing supports several types of elements that you can combine to create sophisticated routing flows”), which is routing configuration—not per-model SynchronousInput field definitions. Agent channel kinds and K2 stream inputs address agents and streaming platforms, not the Workers AI raw schema blocks quoted above. R2 pipeline sinks cover export formats for pipeline output, not model inference schemas.

When your question is strictly “which invocation modes does this hosted model document?”, use the model’s API Schemas (Raw) section on Workers AI or the @cf catalog page.

  1. Open the exact model you run in production—for example workers-ai/models/bge-base-en-v1.5 or ai/models/@cf/deepseek-ai/deepseek-v4-flash-0731—and locate API Schemas (Raw).

  2. Write down whether the page lists four schemas (sync + batch) or six (sync + streaming + batch), and match your client to SynchronousInput, StreamingInput, or BatchInput accordingly.

  3. Open the paired URL in the table above for the same model and confirm the schema names match between Workers AI and the AI catalog.

  4. For an LLM that lists streaming schemas, exercise one synchronous and one streaming call in your staging environment and confirm the response envelope matches the documented output schema name (SynchronousOutput vs StreamingOutput).

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If a schema list on a model page has changed or this page misstates which modes a model supports, email yimasynthetic@gmail.com with the page URL and the exact statement you believe is wrong.