Skip to content
AnswerWell geo Documentation

Research · 4 min read · Answerwell

Model API Schemas: Synchronous and Streaming I/O

What SynchronousInput, StreamingOutput, and related Workers AI raw API schemas mean, and how they appear across model catalog pages.

This page summarises how Cloudflare Workers AI and the parallel Cloudflare AI model catalog document inference APIs. On every model page in the cluster below, the API Schemas (Raw) section lists the same four schema type names. The page explains what those names refer to, how the two doc sites relate, and how to confirm which schemas a model exposes—without walking through a full integration.

API Schemas (Raw): the four schema types on model pages

Section titled “API Schemas (Raw): the four schema types on model pages”

Each catalog entry’s raw schema list names four request/response shapes used for calling that model over HTTP from Workers or other Cloudflare AI clients.

SynchronousInput
SynchronousOutput
StreamingInput
StreamingOutput

— Cloudflare, Llama 3.1 8B Instruct FP8 (Workers AI)

The same four names appear on the matching AI-catalog URL for that model, for example Llama 3.1 8B Instruct FP8 (@cf). They also appear on every other model page in this cluster—from small instruct models such as Llama 3.2 1B Instruct through larger chat, code, and vision models such as Qwen2.5 Coder 32B Instruct, Llama 3.2 11B Vision Instruct, and DeepSeek R1 Distill Qwen 32B.

In plain terms, SynchronousInput / SynchronousOutput name the payload shapes for a call where the client waits for a single completed result object, while StreamingInput / StreamingOutput name the shapes used when the API documents a streaming-style interaction. The cluster only shows the type names in API Schemas (Raw); field-level definitions live on each model’s page in that section and in the generated client bindings Cloudflare publishes for Workers AI.

Synchronous vs streaming schemas: when to use which

Section titled “Synchronous vs streaming schemas: when to use which”

Choosing between the synchronous and streaming schema pairs is a product and UX decision, not something that changes per model family in this catalog pattern.

Pair Schema types Typical use
Synchronous SynchronousInput, SynchronousOutput Short responses, batch jobs, server-side transforms where you need one JSON (or binary) body to parse once
Streaming StreamingInput, StreamingOutput Chat UIs, long completions, or any client that renders partial output as it arrives

All models in the cluster expose both pairs in API Schemas (Raw). That means the platform documents two call shapes per model; your application picks one per request. Vision models (for example Llama 3.2 11B Vision Instruct) and text-only models share the same four-type pattern—the difference is in the fields inside each schema on that model’s page, not in the list of schema names.

Workers AI model URLs and AI catalog @cf URLs

Section titled “Workers AI model URLs and AI catalog @cf URLs”

Cloudflare publishes two doc paths per model. Content in the cluster is duplicated across them—the API Schemas (Raw) block is identical on both.

Doc set Example path pattern Example model
Workers AI models developers.cloudflare.com/workers-ai/models/{slug}/ Mistral Small 3.1 24B Instruct
AI models (@cf) developers.cloudflare.com/ai/models/@cf/{org}/{slug}/ Mistral Small 3.1 24B Instruct (@cf)

Use the Workers AI page when you are wiring Workers AI in a Worker; use the @cf AI-catalog page when you need the canonical model identifier path (@cf/meta/..., @cf/qwen/..., etc.). For schema names, either URL is authoritative—the four types match.

Models in this cluster that share the same raw schema list

Section titled “Models in this cluster that share the same raw schema list”

The following Workers AI pages all document the same API Schemas (Raw) quartet (each has a matching ai/models/@cf/... sibling in the cluster):

  1. Assuming only chat models get StreamingOutput. The raw schema list includes StreamingInput and StreamingOutput on non-chat models too (for example Granite 4.0 H Micro).
  2. Mixing schema pairs in one request. SynchronousInput is documented with SynchronousOutput; streaming calls use the streaming pair. Validate against API Schemas (Raw) on the model you call, not against another model’s example.
  3. Using the wrong doc host for the model ID. Slugs align between Workers AI and AI models URLs, but the @cf path is what you quote in env.AI.run('@cf/...')-style bindings.
  4. Ignoring LoRA / quant suffixes. Gemma 2B IT LoRA and Llama 3.1 8B Instruct FP8 are different deployable IDs; schema names are the same, fields may differ.
  1. Open the Workers AI model page for the @cf model ID you run in production.
  2. Scroll to API Schemas (Raw) and confirm all four types are present: SynchronousInput, SynchronousOutput, StreamingInput, StreamingOutput.
  3. Compare the same model on the AI catalog @cf URL and verify the raw schema names match.
  4. In your Worker or API client, align request serialization with either the synchronous or streaming input schema for that model—not a mixture of both.
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page does not match the current Cloudflare model documentation, or you need a clarification on SynchronousInput versus StreamingOutput, write to yimasynthetic@gmail.com with the page URL and the exact statement you are questioning.