Nirmos
Prompt management

Create and manage prompts

Create prompt identities, maintain metadata, and save content.

Use prompts for management metadata, list/delete, branches and immutable versions. A server API key needs the matching prompt:read, prompt:create, prompt:update or prompt:delete permissions.

Model names beginning with configured/ are placeholders. Replace them with an accessible provider-qualified identifier from model discovery. The snippets reuse the server client from the quickstart.

Create and update metadata

const prompt = await nirmos.prompts.create({ name: "Support reply", slug: "support-reply" });
console.log(prompt.promptId, prompt.branchId);
await nirmos.prompts.update(prompt.promptId, {
  name: "Support reply", slug: "support-reply", description: "Support instructions",
});

Creation returns { promptId, branchId }; it does not publish content. Metadata updates require name and slug. Save and publish content through versions, branches and releases.

Find and retire resources

const page = await nirmos.prompts.list({ limit: 25 });
for (const prompt of page.items) console.log(prompt.id, prompt.name);

Archive/restore preserve history. Deletion is a separate mutation. Check application consumers and pinned references before retiring resources. Exact signatures are in the prompt methods.

Create content through the runtime protocol

managedPrompts.create combines identity and initial content for a simple text/chat template. It uses a different DTO and returns normalized prompt content. It does not provide branch/list/delete management.

const prompt = await nirmos.managedPrompts.create({
  name: "Support reply",
  slug: "support-reply",
  content: { type: "chat", messages: [{ role: "system", content: "Help {{customerName}} using a {{tone}} tone." }] },
  variables: [
    { name: "customerName", type: "string", required: true },
    { name: "tone", type: "enum", values: ["warm", "formal"], default: "warm" },
  ],
  tags: ["support"],
  metadata: { owner: "support-platform" },
  commitMessage: "Initial support template",
  activate: true,
});
const rendered = await nirmos.managedPrompts.render(prompt, { customerName: "Asha" });
console.log(prompt.id, prompt.version.number, rendered.messages);

name and content are required. Optional fields include slug, description, variables, metadata, tags, folder, commitMessage and activate. Slug can be derived on runtime; set it explicitly for application references. activate: true publishes the initial version; without it creation defaults to draft and active retrieval may return 404.

See variables and rendering for placeholder syntax and validation. activate: true additionally needs prompt:publish.

Creation clears this client's prompt cache. It has no general server deduplication guarantee: do not enable retries with an arbitrary idempotency header.

Managed prompt reference · Types · Updating versions

On this page