POST /inference/v0/run/{org_id}/{flow_id}
Run a flow and get the result.
How to use
Send the workflow input map as the entire JSON body. The flow must be published. Omit execution_mode for inline JSON or SSE; request remote without SSE for a 202 background handle. Do not resend after a timeout without checking whether execution started.
Authentication and permissions
Required permissions: projects.run. Resource and owner access checks also apply.
Prepare request.json
Save the example body below as request.json for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.
{
"in-0": "Summarize our refund policy"
}Personal API key or the endpoint-specific legacy organization API key. Legacy inference uses the public organization key; legacy analytics uses the private organization key. This is not a password-grant login flow.
The flow ID. Learn how to get it.
Version of the flow
-1Return the full model
trueStream deltas instead of full output. Only applies when streaming (Accept: text/event-stream).
trueAdd a prefix to the output. Only applies when streaming (Accept: text/event-stream).
falseSet to 'remote' to run durably in the background and receive a 202 with a WebSocket handle. Omit for inline execution (JSON, or SSE when the request sends Accept: text/event-stream).
Input parameters for the flow
The run-result envelope (same InferenceResponse shape as resume): a terminal state + outputs, or state=PAUSED with the pause payload when the run pauses on a human-in-the-loop step. With Accept: text/event-stream the run streams back as SSE InferenceResponse frames instead.
Returned with execution_mode=remote and no Accept: text/event-stream: the run executes durably in the background; the body carries the run_id and a WebSocket handle to stream updates. Poll GET /runs/{org_id}/{run_id} for the terminal state.
Project is not published
Validation Error
curl --fail-with-body -sS \
"$STACKAI_BASE_URL/inference/v0/run/${ORG_ID}/${FLOW_ID}" \
-H "Authorization: Bearer $STACKAI_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @request.json{}Last updated
Was this helpful?

