SDK

Add scheduling to your product's agents.

Use Cronlet as the execution and scheduling layer behind your own product. Your agents create tasks - through the SDK, receive structured callbacks, and manage schedules.

Built for product teams

Works with any LLM

Pre-built tool definitions for OpenAI, Anthropic, and LangChain. Your agent gets scheduling tools in one line of code.

Close the loop

Get results back after every run with your original context. Your app decides what happens next.

No cron, ever

Natural language schedules in the SDK. Your agents write "every friday at 9am", not cron expressions.

Full dashboard visibility

Every task your agents create is tracked by source and visible alongside manual tasks. One place to see everything.

Install

Install
npm install @cronlet/sdk
Client
const cronlet = new CloudClient({
  apiKey: process.env.CRONLET_API_KEY,
  baseUrl: process.env.CRONLET_BASE_URL,
});

Works with any model provider

TypeScript
import OpenAI from "openai";
import { CloudClient, cronletTools, createToolHandler } from "@cronlet/sdk";

const openai = new OpenAI();
const cronlet = new CloudClient({ apiKey: process.env.CRONLET_API_KEY });
const handler = createToolHandler(cronlet);

const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Create a task that pings my API every hour" }],
  tools: cronletTools.openai,
});

for (const toolCall of response.choices[0].message.tool_calls ?? []) {
  const result = await handler.handleOpenAI(toolCall);
  console.log(result);
}

Callback loop

Callback Handler
app.post("/cronlet/callbacks", async (request, reply) => {
  const payload = request.body;

  if (payload.event === "task.run.completed") {
    await reconcileRun(payload.task.id, payload.run.id, payload.run.output, payload.task.metadata);
  }

  if (payload.event === "task.run.failed") {
    await flagScheduleForReview(payload.task.id, payload.run.errorMessage);
  }

  reply.send({ ok: true });
});

Your app creates the schedule. Cronlet executes it. Your callback decides what happens next.