For the complete documentation index, see llms.txt. This page is also available as Markdown.

POST /inference/v0/run/{org_id}/{flow_id}

Run Deployed Flow

post

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"
}
Authorizations
AuthorizationstringRequired

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.

Path parameters
org_idstringRequired
flow_idstringRequired

The flow ID. Learn how to get it.

Query parameters
versionintegerOptional

Version of the flow

Default: -1
verbosebooleanOptional

Return the full model

Default: true
deltabooleanOptional

Stream deltas instead of full output. Only applies when streaming (Accept: text/event-stream).

Default: true
prefixbooleanOptional

Add a prefix to the output. Only applies when streaming (Accept: text/event-stream).

Default: false
execution_modestring · enum · nullableOptional

Set 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).

Possible values:
Body

Input parameters for the flow

Other propertiesanyOptional
Responses
200

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.

objectOptional
post/inference/v0/run/{org_id}/{flow_id}
curl
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?