Docs menu
Get started

Quickstart

Your first request in under a minute. If you have OpenAI code already, this is a drop-in change.

1 · Create a key and add credit

Create a key on the API keys page and add credit on Billing. Keep the key on your server, in an environment variable such as SLUICE_API_KEY.

Keep keys server-side
A key can spend your balance. Never ship it in browser or mobile code; set a per-key spend limit on the keys page for extra safety.

2 · Point your SDK at Sluice

Use the official OpenAI SDK — just change the base URL and key:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.sluice.one/v1",
  apiKey: process.env.SLUICE_API_KEY, // sk-sluice-...
});

const res = await client.chat.completions.create({
  model: "llama-3.3-70b",
  messages: [{ role: "user", content: "Hello" }],
});

console.log(res.choices[0].message.content);
console.log(res.sluice); // { provider, model_used, cost_usd, charged_usd, saved_usd }

3 · Read what it saved

That's it — you're routing. Every response carries a sluice object with the cost and the saving, so you can see the benefit on the very first call. Next, learn the request and response shape in full.