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 { Maskea, retries } from "@nopeatech/maskea";
import OpenAI from "openai";
const openai = new OpenAI();
const maskea = new Maskea().use(
retries({ max: 3, backoff: "exponential" })
);
const chat = maskea.wrap(
openai.chat.completions.create.bind(openai.chat.completions)
);Checked against the shipped @nopeatech/maskea API. Full docs at nopea.tech/maskea/docs.