Reduce inference costs with exact caching
Enable exact response caching with supported SDK headers, inspect cache metadata, and choose safe request boundaries.
From a workspace to a working model call. A practical starting point for building with Nirmos, with the detailed docs one click away.
One request path. Your application stays in control.
Nirmos brings Gateway, Prompts, Knowledge, Evaluations, and Memory into one platform. Create an account and choose the organization your application will use.
Create your accountAdd your provider credentials in your authenticated workspace, then choose an enabled chat model. Nirmos uses your organization’s configured credentials to call the provider.
A catalog entry alone doesn’t grant upstream model access. Your credentials need permission and available quota.
In the dashboard, create a personal key for your scripts or a service key for your application with gateway execution permission. Bind the key to the organization you configured. Store its one-time secret in your server environment as NIRMOS_API_KEY.
Keep secrets on your server. Never put an API key in browser code, public environment variables, or source control.
Use a trusted Node.js application and install the SDK. This example comes directly from the current SDK quickstart. It checks authentication and makes a gateway call using the model you select. Replace the provider and model placeholders before running it.
pnpm add @nirmos/sdkimport { Nirmos, NirmosError } from "@nirmos/sdk";
const key = process.env.NIRMOS_API_KEY;
if (!key) throw new Error("Missing NIRMOS_API_KEY");
const nirmos = new Nirmos({
auth: { type: "api-key", key },
apiBaseUrl: process.env.NIRMOS_API_URL,
runtimeBaseUrl: process.env.NIRMOS_RUNTIME_URL,
});
try {
const context = await nirmos.auth.getContext();
console.log("Organization:", context.organizationId);
const completion = await nirmos.gateway.chat.create({
model: "<provider-slug>/<model-slug>",
messages: [{ role: "user", content: "Explain an AI gateway in two sentences." }],
maxOutputTokens: 200,
});
console.log(completion.outputText);
console.log("Request:", completion.metadata.requestId);
} catch (error) {
if (error instanceof NirmosError) {
console.error({ code: error.code, status: error.status, requestId: error.requestId });
}
throw error;
}Set NIRMOS_API_KEY in your server environment, replace <provider-slug>/<model-slug>, save the example as quickstart.mjs, then run node quickstart.mjs. Self-hosting? Configure the API and runtime origins as described in the quickstart.
Start with a model call. Add the instructions, evidence, feedback, and context your application needs.
Version the instructions. Publish a release your application can retrieve by name.
Retrieve relevant source chunks. Pass the evidence to your model.
Compare prompts and models against your datasets before a release.
Explicitly store useful context and retrieve it across conversations.
Practical reading for the requests that come next.
Enable exact response caching with supported SDK headers, inspect cache metadata, and choose safe request boundaries.