The SDKs come with a widar workspace: widar’s sales team provides them. Every call is also a plain HTTP call to https://api.widar.com, shown as curl on every page of the API reference.
Mark an output
// Client: widar's TypeScript SDK, provided with your workspace
import { readFile, writeFile } from "node:fs/promises";
const widar = new Client(); // reads WIDAR_API_KEY
const marked = await widar.markings.create({
systemId: "sys_4kT9qWm2RbXe",
file: await readFile("output.png"),
contentType: "image/png",
idempotencyKey: "lumen-out-7731",
});
await writeFile("marked.png", marked.body);
console.log(marked.markId, marked.manifestId);What every SDK does
- Reads the key from
WIDAR_API_KEY, or takes it when the client is made. Never logs it. - Retries a
429, a5xxor a lost connection with backoff, as long asRetry-Afterasks, with the sameIdempotency-Key, a capped number of times. - Pages through lists for you, and answers the API’s own objects with their fields in your language’s case.
- Raises one error type with the API’s
code,message,statusandrequest_id. - Every SDK passes the same conformance suite before a release.
Errors
// Client and ApiError: widar's TypeScript SDK, provided with your workspace
const widar = new Client(); // reads WIDAR_API_KEY
try {
await widar.markings.create({ systemId: "sys_4kT9qWm2RbXe", file, contentType: "image/gif" });
} catch (e) {
if (e instanceof ApiError && e.code === "marking_failed") {
// held back: the policy fails closed. Do not serve the file.
}
throw e;
}Every page in the API reference shows each call in all four languages, beside the API call, the CLI command and the MCP tool. An agent can use the MCP server at https://widar.com/mcp instead.