Model chain API engine

BabyChain

Model chain API engine for image and video workloads with one durable pipeline and one final callback. Every output becomes the next input.

text-to-image, image-to-image, image-to-video, final callback, durable run state, inference failover, text-to-image, image-to-image

Built-in chain APIs

Three routes. One execution language.

chain101

text-to-image → image-to-video

Run a text-to-image model, then pass its generated image URL into an image-to-video model.

text-to-image ➜ image-to-video
chain202

image-to-image → image-to-video

Run an image-to-image model, then pass its generated image URL into an image-to-video model.

image-to-image ➜ image-to-video
chain303

text-to-image → image-to-image → image-to-video

Run a text-to-image model, pass its generated image URL into an image-to-image model, then pass its refined image URL into an image-to-video model.

text-to-image ➜ image-to-image ➜ image-to-video

API Lab

Chain routes with swappable models.

Deploy your own BabyChain, choose the route shape that fits your workflow, and start chaining your image and video models through one durable API with result fetches and signed final callbacks built in.

babychain://runbookline 1/3running
$

01 Request

Create chain run

curl --request POST \  --url https://your-babychain.example.com/api/v1/chains/chain1/runs \  --header "Authorization: Bearer BABYCHAIN_API_KEY" \  --header "Content-Type: application/json" \  --header "Idempotency-Key: sky-blue" \  --data '{  "input": {    "chain_models": {      "text_to_image_model": "bfl/flux-2-flex",      "image_to_video_model": "bytedance/seedance-1.5-pro"    },    "text_to_image_params": {      "prompt": "A futuristic wireless headphone product on a clean reflective pedestal, teal and violet studio lighting, premium product photography, soft shadows, high detail",      "width": 1024,      "height": 1024,      "prompt_upsampling": false,      "seed": 593,      "safety_tolerance": 5,      "output_format": "jpeg"    },    "image_to_video_params": {      "content": [        {          "type": "text",          "text": "Slow cinematic orbit around the product, subtle glow animation, premium studio reflections, smooth camera motion"        }      ],      "ratio": "1:1",      "duration": 3,      "watermark": false    }  },  "webhook_url": "https://your-webhook.example.com"}'

02 Response excerpt

Durable run accepted

{  "id": "e0a5c7b3-6d14-4f89-b2c1-9a8e3f5d70c6",  "object": "chain_run",  "chain_slug": "chain1",  "chain_version": "2026-05-23",  "mode": "byok",  "status": "queued",  "input": {    "chain_models": {      "text_to_image_model": "bfl/flux-2-flex",      "image_to_video_model": "bytedance/seedance-1.5-pro"    },    "text_to_image_params": {      "prompt": "A futuristic wireless headphone product on a clean reflective pedestal, teal and violet studio lighting, premium product photography, soft shadows, high detail",      "width": 1024,      "height": 1024,      "prompt_upsampling": false,      "seed": 593,      "safety_tolerance": 5,      "output_format": "jpeg"    },    "image_to_video_params": {      "content": [        {          "type": "text",          "text": "Slow cinematic orbit around the product, subtle glow animation, premium studio reflections, smooth camera motion"        }      ],      "ratio": "1:1",      "duration": 3,      "watermark": false    }  },  "created_at": "2026-05-26T20:15:11.866894+00:00",  "updated_at": "2026-05-26T20:15:11.866894+00:00",  "current_step_key": "processing",  "steps": [    {      "id": "5b7f2a91-c0e4-4d38-8f6a-1c9d7e3b42a5",      "step_index": 0,      "step_key": "text_to_image",      "step_kind": "image",      "model_identifier": "bfl/flux-2-flex",      "status": "queued",      "created_at": "2026-05-26T20:15:11.967529+00:00",      "updated_at": "2026-05-26T20:15:11.967529+00:00",      "depends_on": [],      "started_at": null,      "completed_at": null    },    {      "id": "9c1e4b7a-2f83-4d6c-a5b0-7e9f3a1d8c62",      "step_index": 1,      "step_key": "image_to_video",      "step_kind": "video",      "model_identifier": "bytedance/seedance-1.5-pro",      "status": "queued",      "created_at": "2026-05-26T20:15:11.967529+00:00",      "updated_at": "2026-05-26T20:15:11.967529+00:00",      "depends_on": [        "text_to_image"      ],      "started_at": null,      "completed_at": null    }  ]}

03 Result code

Fetch final state

curl --request GET \  --url https://your-babychain.example.com/api/v1/chains/get/{runId} \  --header "Authorization: Bearer BABYCHAIN_API_KEY"

04 Result excerpt

Terminal payload

{  "id": "e0a5c7b3-6d14-4f89-b2c1-9a8e3f5d70c6",  "object": "chain_run",  "chain_slug": "chain1",  "chain_version": "2026-05-23",  "mode": "byok",  "status": "succeeded",  "input": {    "chain_models": {      "text_to_image_model": "bfl/flux-2-flex",      "image_to_video_model": "bytedance/seedance-1.5-pro"    },    "text_to_image_params": {      "prompt": "A futuristic wireless headphone product on a clean reflective pedestal, teal and violet studio lighting, premium product photography, soft shadows, high detail",      "width": 1024,      "height": 1024,      "prompt_upsampling": false,      "seed": 593,      "safety_tolerance": 5,      "output_format": "jpeg"    },    "image_to_video_params": {      "content": [        {          "type": "text",          "text": "Slow cinematic orbit around the product, subtle glow animation, premium studio reflections, smooth camera motion"        }      ],      "ratio": "1:1",      "duration": 3,      "watermark": false    }  },  "created_at": "2026-05-26T20:15:11.866894+00:00",  "updated_at": "2026-05-26T20:17:39.695124+00:00",  "current_step_key": "completed",  "steps": [    {      "id": "5b7f2a91-c0e4-4d38-8f6a-1c9d7e3b42a5",      "step_index": 0,      "step_key": "text_to_image",      "step_kind": "image",      "model_identifier": "bfl/flux-2-flex",      "status": "succeeded",      "created_at": "2026-05-26T20:15:11.967529+00:00",      "updated_at": "2026-05-26T20:15:55.765222+00:00",      "depends_on": [],      "started_at": "2026-05-26T20:15:37.154+00:00",      "completed_at": "2026-05-26T20:15:55.744+00:00",      "generation_output_file": [        "https://example-storage.bfl.ai"      ]    },    {      "id": "9c1e4b7a-2f83-4d6c-a5b0-7e9f3a1d8c62",      "step_index": 1,      "step_key": "image_to_video",      "step_kind": "video",      "model_identifier": "bytedance/seedance-1.5-pro",      "status": "succeeded",      "created_at": "2026-05-26T20:15:11.967529+00:00",      "updated_at": "2026-05-26T20:17:39.604698+00:00",      "depends_on": [        "text_to_image"      ],      "started_at": "2026-05-26T20:16:52.097+00:00",      "completed_at": "2026-05-26T20:17:39.577+00:00",      "generation_input_file": [        "https://example-storage.bfl.ai"      ],      "generation_output_file": [        "https://example-storage.ark-byteplus.com"      ]    }  ]}

Chain run lifecycle

From one request to one final callback.

BabyChain turns one API call into a durable model pipeline: receive input, run each step, pass outputs forward, recover async state, and deliver the final callback.

Accept one chain request

Receive caller input, step params, model choices, idempotency key, metadata, and callback URL.

Run model steps in order

Start one generation step at a time and pass each successful output URL into the next compatible model.

Recover async execution

Use webhooks and cron fallback to advance durable run state without blocking the caller app.

Deliver final callback

Send a signed terminal payload with final outputs, step statuses, and backend metadata when a callback URL is configured.

Ship your chain API engine

Fork and run it.