Endpoints

Run a flow

POST /api/run/{flow} runs a flow with an input, optional tweaks and a session, and returns or streams its outputs.

http
POST /api/run/{flow_id_or_name}

{flow_id_or_name} is the flow's id (in the canvas address bar) or its endpoint name.

Example

bash
curl -X POST "https://app.chainz.waiyers.com/api/run/$FLOW_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input_value": "Summarise the news about solar panels",
    "input_type": "chat",
    "output_type": "chat"
  }'

Body

FieldTypeWhat it is
input_valuestringThe value given to the flow's input component.
input_typestringWhich input component receives the value: chat (default), text or any.
output_typestringWhich outputs to return: chat (default), text, any or debug (every component's output).
output_componentstringWhen the flow has several outputs, the id of the one to return.
tweaksobjectSettings to change for this run only, keyed by component id.
session_idstringKeeps a conversation going across runs: send the same id each time.

Tweaks

Change a component's setting for one run, without editing the flow. The key is the component's id (its type and a short code, as in Get a flow), the value its fields:

json
{
  "input_value": "Write a caption for our new bottle",
  "tweaks": {
    "WaiyersModelCall-a1b2c": { "temperature": 0.2 }
  }
}

Streaming

Add ?stream=true to receive the result as it is produced, as server-sent events:

EventCarries
add_messageA new message of the run.
tokenA piece of text, as the model writes it.
endThe final result.

Who can run a flow

You, and the members of the team that owns the flow's workspace. Others get 403.

Cost

A run through the API costs the same as in the app and appears in History with the others. See Credits.

Was this page helpful?

Last updated 2026-10-13