Providers
OpenAI + exponential backoff
Wrap chat.completions.create with retries({ max: 3, backoff: "exponential" }) so transient 429s never bubble up to your users.
← All recipes
import { Klaro, retries } from "@klaroshield/sdk";
import OpenAI from "openai";
const openai = new OpenAI();
const klaro = new Klaro().use(
retries({ max: 3, backoff: "exponential" })
);
const chat = klaro.wrap(
openai.chat.completions.create.bind(openai.chat.completions)
);Checked against the shipped @klaroshield/sdk API. Full docs at klaro.services/klaroshield/docs.