SDKS

SDKs

Official TypeScript and Python clients for the two calls. Zero dependencies, typed errors, retries with Retry-After, and an Idempotency-Key on every Rowe request so retries never double-bill. npm install fourechelon; pip install fourechelon.

Install

Both clients wrap the same two calls, generate an Idempotency-Key per Rowe request, retry 429 and 5xx with Retry-After, and raise a typed error carrying status, type, and request_id. No dependencies in either.

npm install fourechelon

Extract a file, then ask Rowe

import { FourEchelon } from "fourechelon";
const key = process.env.FOUR_ECHELON_API_KEY!;
const fe = new FourEchelon({ apiKey: key });
// A file becomes geometry: path, bytes,
// Blob, or { url } for files over ~4 MB.
const scene = await fe.cad.extract({
file: "cabinet.drawio",
targetContract: "both",
});
scene.structure?.kind; // "diagram2d"
scene.structure?.pages?.[0].relations;
// [{ type: "contains", subject: "cab",
// object: "plc" }, ...]
// Ask Rowe about the same geometry.
const answer = await fe.responses.create({
input: {
task_type: "understand",
cad_scene: scene,
},
});

What the clients cover

cad.extractmethod

Path, bytes, Blob, or { url } in; four-cad.extraction.v1 out. { url } is the way past the ~6 MB request limit (up to 25 MB).

cad.extractBatch / getBatch / waitForBatchmethods

Up to 32 files asynchronously; waitForBatch polls until done, failed, or expired.

responses.createmethod

POST /api/v1/responses with model defaulting to rowe-1.0 and a generated Idempotency-Key.

models.listmethod

GET /api/v1/models, unauthenticated: pricing, tasks, runtime_available.

requestmethod

Low-level call for routes the SDK has not wrapped yet, with the same retries and errors.

FourEchelonErrorclass

status, type, requestId, details, and the raw body.

Source lives in the public repo under packages/sdk and packages/sdk-python. Agents can skip the SDK entirely and use the MCP server or the OpenAPI document.