Configure AI endpoints
Pin prompt versions and define reusable execution inputs.
An AI endpoint binds a prompt/version, variable resolution and optional output/provider configuration. Management uses apiBaseUrl; execution uses runtimeBaseUrl. You need a published prompt version, its prompt/branch IDs, organization management permissions and endpoint/gateway execute permission.
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 an endpoint
const endpoint = await nirmos.endpoints.create({
name: "Support reply",
slug: "support-reply",
promptId: "prompt-id",
branchId: "branch-id",
promptVersionId: "published-version-id",
variables: [{
name: "question",
type: "string",
resolution: { type: "input", required: true },
}],
inputs: [],
providerConfig: { model: "configured/chat-model", maxTokens: 500 },
});
if (!endpoint.id) throw new Error("Endpoint creation did not return an ID");
await nirmos.endpoints.setStatus(endpoint.id, { active: true });Choose variables matching the pinned prompt. The create DTO requires arrays for variables and inputs. Resolution can be input, fixed or calculated; complex expression/output contracts need backend validation, not client-side type assumptions.
Manage releases
Use list, get, promptOptions and overview for discovery. update supports partial endpoint configuration changes. duplicate, archive, delete and setStatus manage lifecycle. Changing a prompt's latest version does not replace the explicitly pinned endpoint version.
Missing/disabled endpoints, required input failures, permissions and output validation failures need separate handling. Inspect the HTTP error and resolved response fields. See endpoint reference and REST endpoints.
Execute the endpoint after provisioning. Endpoint evaluation targets are a separate feature and are currently disabled; do not use them as runnable evaluation targets.