SegmindSegmind / Docs

Publish a Workflow as an API

Turn any PixelFlow workflow into a production REST API: name your inputs and outputs, publish a version, test it in the console, and call it from your code.

Any workflow can become a REST endpoint. Callers send your named inputs as JSON, Segmind runs the graph in the cloud, and they get your named outputs back — your whole pipeline behind one API call.

Video coming soon

Naming inputs and outputs, publishing, and testing the API

https://segmind-resources.s3.amazonaws.com/docs/pixelflow/publish/publish-flow.mp4

Name your inputs

Give each input node that callers should control a key name — that becomes the JSON field name in API requests. An input named prompt is called with {"prompt": "..."}. Inputs without key names keep their canvas values.

Name your outputs

Do the same for output nodes: each key-named output becomes a field in the API response.

Publish

Click Publish in the editor. The publish dialog shows your endpoint, the request and response contract derived from your named nodes, and ready-to-copy code samples (cURL, Python, JavaScript).

Screenshot coming soon

The published API's contract

/images/pixelflow/publish/api-info-panel.webp

Test it

Use the built-in test panel to fill in your inputs, send a real request, and inspect the response — without leaving the console.

Screenshot coming soon

Testing the published API in the console

/images/pixelflow/publish/api-test-panel.webp

Versions

Each publish creates a new immutable version — v1, v2, and so on. Published versions keep serving exactly what you published, so you can keep editing the workflow freely and publish again when ready. The version is shown beside the API status in the editor.

Working with image arrays

If an image input is connected to a parameter that accepts an array, callers can pass an array of image URLs to process multiple images in one request:

{
  "image_list": [
    "https://example.com/image1.png",
    "https://example.com/image2.png",
    "https://example.com/image3.png"
  ]
}

This pairs naturally with fan-out: the array fans out inside the workflow and each image is processed in parallel.

Calling your API

Published workflows run asynchronously: submit a request, poll for status, fetch the result. Full request/response shapes and code samples are in the API reference.

Published-workflow runs consume credits from your account like any other model usage — see pricing and billing.

On this page