Skip to documentation
Open Workflow Studio
On this page

Model

Workflow reference | Expressions

Kind: Model
Configuration object: model

Use Model to invoke a configured playground or provider protocol. It supports text generation and supported image, video, document, retrieval, file-based speech operations, and bounded Grok Voice 3 text turns. Configure a model through its hosted playground and apply the settings to capture a portable request.

Inputs

The step receives the current input and any named incoming bindings. inputTemplate formats the prompt before request-body rendering. requestBody can use placeholders such as {{input}} and {{research}}.

For text protocols, a request body without placeholders receives the rendered input as an additional user input or message. An empty inputTemplate suppresses that automatic appending. JSON and Speech protocols require explicit input placement in their request bodies.

Image and video steps can also consume attachmentTemplates. Each template resolves to a supported media source or collection. File-based speech uses the captured audioSource or text envelope. Grok Voice 3 maps text into one native realtime turn. Live microphone capture, continuous conversations, and phone call control remain in the dedicated speech playgrounds.

Configuration

Property Default Usage
playground "openai" Playground family used for request adaptation, media handling, and editor restoration. Capture this from the intended playground.
model "" Actual provider model or deployment name, up to 256 characters. Required for text protocols and most speech operations.
protocol Responses Protocol from the table below.
endpoint "" Required public HTTPS operation endpoint, or supported resource base endpoint for a captured adapter. Endpoint placeholders are URL-escaped.
endpointName "" Optional Vault or packaged-host endpoint reference. It must resolve to an actual endpoint before invocation.
allowEndpointSecrets false Explicit approval for credential-bearing connection URLs. Sensitive URLs remain unsuitable for persisted libraries.
credentialName "MODEL_API_KEY" Runtime credential reference. Required; credential values stay outside the workflow.
authenticationHeader "api-key" Supported provider authentication header, such as api-key, Authorization, or x-api-key.
authenticationPrefix "" Empty or Bearer as appropriate. Key is supported only for the configured fal.ai video JSON adapters with Authorization.
tokenScope Unset Optional Entra scope passed to the credential resolver. Match the endpoint and authentication scheme.
headers {} Up to 32 non-secret, safe headers. Values support input templates.
requestBody "{}" JSON-object text, at most 256 KiB. This is the authoritative request configuration.
inputTemplate "{{input}}" Text template, at most 256 KiB. Exact {{input}} in model JSON remains a prompt string.
settings {} Captured editor settings. At most 512 entries with bounded values. These restore the playground; they do not replace requestBody.
attachmentTemplates [] Up to 16 templates, with a combined 256 KiB configuration budget. Available for supported image/video JSON adapters.
useWebVttTiming false Timed synthesis for mai-voice, grok-text-to-speech, or gpt-audio-text-to-speech under the Speech protocol. Requires WAV or MP3 output.
outputUploadUrlName Unset Optional runtime upload-URL reference for Imagine Video.
outputDownloadUrlName Unset Optional runtime download-URL reference for Imagine Video.

Protocols

Protocol Request and response behavior
Responses Responses-compatible input; consumes supported streamed or buffered response events.
ChatCompletions Chat Completions-compatible messages; consumes supported streamed or buffered completions.
Anthropic Anthropic message protocol and its content events.
Cohere Supported Cohere chat request, including captured legacy message requests.
MuseSpark Responses or Chat Completions handling according to the captured request shape.
Json Captured JSON/media/document/retrieval requests, with supported provider job polling.
Speech Portable speech-options envelope; the adapter constructs JSON, multipart, SSML, or a bounded native Grok Voice 3 WebSocket turn after rendering inputs.

Request-body model names must match model where the protocol requires that check. Avoid saving previous-response IDs, conversation history, credentials, executable tool definitions, or output state in editor settings.

Supported file-based speech playgrounds are mai-transcribe, mai-voice, gpt-transcribe, grok-speech-to-text, grok-text-to-speech, gpt-audio-text-to-speech, gpt-audio-understanding, and gpt-audio-speech-to-speech. Capture their settings from the corresponding playground to obtain the validated envelope.

Grok Voice 3 text turns

Select Grok Voice 3 in the Model step's Voice & Speech group, or load an industry rehearsal. Its playground ID is grok-voice-3, with the Speech protocol and grok-voice-3.0 model. grok-voice-latest is also accepted; built-in templates pin the version. Supply an xAI API key through the configured credential reference.

The envelope accepts model, text, voice, instructions, grokReasoningEffort, speed, grokOutputCodec, grokOutputSampleRate, grokOutputTransport, and pronunciationReplacements. Map text explicitly. Instructions are limited to 4,096 characters, and text to 60,000. Reasoning is high or none; speed is 0.7 to 1.5. Output must use audio/pcm over json, at a documented PCM sample rate. Native search, MCP, and function tools must be cleared before capturing settings. Unsupported tools and codecs fail explicitly. Use upstream MCP or REST steps for authorized context retrieval.

The adapter obtains an ephemeral credential from POST /v1/realtime/client_secrets, connects to the fixed xAI realtime destination with the selected model, waits for the session.updated acknowledgment, and sends one text message plus response.create. It accepts the preceding session.created and conversation.created startup notifications described in the xAI message flow. It disables automatic turns, idle re-engagement, and resumption for this isolated invocation. The result contains the completed transcript, response ID/status/usage, and a downloadable mono PCM WAV. Ephemeral credentials and base64 audio stay outside workflow outputs.

Other informational server notifications can interleave with startup. The adapter records bounded event-type labels as progress and continues waiting for session.updated, subject to the step timeout and event limit. Response and conversation-item events received before acknowledgment fail with the event type in the error. Provider errors and unsupported native tools also fail immediately. Startup event payloads stay outside progress messages.

Output is limited to 25 MB of WAV audio and 200,000 transcript characters, subject to smaller host resource limits and the step timeout. Premature closure, provider errors, malformed audio, and incomplete responses fail without publishing a completed artifact or automatically retrying a billable turn. This adapter exercises scripted conversational responses; interruption, microphone, telephony, native tools, and resumption behavior can be explored in the live Grok Voice 3 playground.

Outputs

Text protocols return the complete extracted model response. If it is valid JSON, downstream bindings expose it as typed JSON. Otherwise it is a string. Supported JSON adapters return the completed JSON result. Speech adapters expose the documented text/response envelope and any audio artifacts.

Image, video, and audio results can include _workflow_media, an array containing id, reference, content_type, file_name, byte_length, and url. Use input._workflow_media[0].reference for a run-local artifact or the appropriate url when the provider returned remote media.

Streamed deltas and progress are visible in Preview. A completed output is required before a downstream step can run. Unfinished job results and incomplete streams fail explicitly. Model usage and costs are reported separately from the output payload.

Example

{
  "id": "draft",
  "name": "Draft a response",
  "kind": "Model",
  "outputName": "draft",
  "model": {
    "playground": "openai",
    "model": "my-chat-deployment",
    "protocol": "Responses",
    "endpoint": "https://example.openai.azure.com/openai/v1/responses",
    "credentialName": "MODEL_API_KEY",
    "authenticationHeader": "api-key",
    "inputTemplate": "Summarize the following research:\n{{input}}",
    "requestBody": "{\"model\":\"my-chat-deployment\",\"input\":\"{{input}}\",\"stream\":true}"
  }
}

Replace the endpoint and deployment with a provisioned connection and supply MODEL_API_KEY in the runtime. For a join, place {{research}} directly in the input template to consume that named source.

Operational notes

Provider availability, schemas, permissions, and pricing remain provider-specific. Use the captured playground configuration and its help links for those settings. The JSON adapter follows only supported polling routes and enforces polling and timeout limits.

Media output is bounded to 16 completed artifacts and 128 MiB of retained media bytes. Speech has its own smaller audio limits. Media downloads are separated from model authentication, and run-local references expire with the run.

Timed WebVTT synthesis needs a configured FFmpeg backend that supports amix normalization and alimiter latency compensation. Older builds lacking these filter options fail with an explicit processing error.

Connect a complete JIT capability descriptor to this step to make the corresponding tools available to the model. Use Multi-turn for feedback-driven conversations and model-selected MCP tools.

An unhandled error has occurred. Reload 🗙