cran-sdk
v0.1.1
Published
Native Cran client — route inference through the control plane without OpenAI env cosplay.
Downloads
15
Readme
cran-sdk
Native Cran client. Your app connects to Cran — not OpenAI. Cran hosts provider keys and applies dashboard-published routing.
Install
npm install cran-sdkAfter cran link, your .env has:
CRAN_API_KEY=cran_…
CRAN_BASE_URL=https://trycran.in/api/v1
CRAN_PROJECT_ID=proj_…Usage
import { createCran } from "cran-sdk";
const cran = createCran();
const { content, model } = await cran.chat(
[{ role: "user", content: "Hello" }],
{ model: "auto" } // uses dashboard-published architecture
);
console.log(model, content);OpenAI SDK (optional compat)
If you already use the OpenAI SDK, you can point it at Cran — but that is compatibility, not the primary model:
OPENAI_API_KEY=cran_… # same connection token
OPENAI_BASE_URL=…/api/v1
cran_…here is the optional proxy-routing connection key (fromcran linkor the dashboard "Generate key"). It routes live traffic through Cran and is not needed for the MCP — that connects via your account login (cran login).
Prefer CRAN_* + cran-sdk for new apps.
