Blitflow
TypeScript SDK

Nodes & single runs

Discover node specs and run single nodes from the SDK.

Search the palette

import { BlitClient, searchNodes } from "@blitflow/sdk";

const client = new BlitClient({ apiKey: process.env.BLITFLOW_TOKEN });

const specs = await searchNodes(client, {
  query: "sprite",
  category: "image",
  limit: 10,
});

All options are optional — omit them to list the whole palette.

Fetch one spec

import { getNode } from "@blitflow/sdk";

const spec = await getNode(client, "rd-fast");

// The spec's ports tell you exactly what to send:
for (const [name, port] of Object.entries(spec.inputs)) {
  console.log(
    name,
    port.connector.id,
    port.connector.optionValues ?? "",
    port.connector.defaultValue ?? "",
  );
}

Read optionValues before sending enum-like inputs (style, modes, sizes) — values outside the enum fail validation. See Nodes & specs.

Run a single node

For one-off inference, skip the workflow entirely:

const { outputs } = await client.ops["runs.node"]({
  node: "rd-fast",
  inputs: {
    prompt: "a brass key on black velvet",
    removeBg: true,
    seed: 7,
    // data ports take Artifacts:
    // init: { kind: "image", ref: "https://…/base.png" },
  },
  maxCostUsd: 0.1,
});

console.log(outputs.image); // { kind: "image", ref: "https://…", … }

Scalars (string / number / boolean / null) work for value ports; Artifacts for images and other binary data. The call returns the node's outputs directly — no event stream.

On this page