Eridian

Prompt Templates

Template CRUD, variable injection, and versioning.

Prompt templates standardize inference requests across teams with versioned, auditable prompt definitions. Templates decouple prompt engineering from application code and ensure every production call references an immutable, reviewable artifact.

Create a Template

POST /v1/templates
Authorization: Bearer eridian_sk_...
Content-Type: application/json

Request Body

FieldTypeRequiredDescription
namestringYesHuman-readable template name
contentstringYesPrompt body with {{variable}} placeholders
variablesarrayYesDeclared variable names used in content
versionstringYesSemantic version (e.g. 3.2.1)
project_idstringYesOwning project
descriptionstringNoChange summary for reviewers
{
  "name": "contract_summary_v3",
  "content": "Summarize the following contract, focusing on {{focus_area}}:\n\n{{document}}",
  "variables": ["focus_area", "document"],
  "version": "3.2.1",
  "project_id": "prj_legal_001"
}

Response

{
  "id": "tpl_contract_summary_v3",
  "object": "eridian.template",
  "name": "contract_summary_v3",
  "version": "3.2.1",
  "status": "draft",
  "created_at": 1718400000
}

Required scope: templates:manage

Publish and Versioning

Templates are immutable once published. To modify content, create a new version:

POST /v1/templates/tpl_contract_summary_v3/versions
{
  "version": "3.3.0",
  "content": "Summarize the following contract, focusing on {{focus_area}}:\n\n{{document}}",
  "changelog": "Require explicit termination-cap language in the output."
}

Published versions cannot be edited in place. Inference responses include eridian.template_id and eridian.template_version for audit trails and cache fingerprinting.

GET /v1/templates/tpl_contract_summary_v3/versions
POST /v1/templates/tpl_contract_summary_v3/publish

Publish moves a draft to published. On Enterprise projects with evals_required, publish is blocked until an evaluation run is attached and dual control approves.

StatusBehavior
draftEditable; not callable from inference
publishedImmutable; callable from inference
deprecatedCallable but flagged in audit logs
archivedNot callable; retained for compliance

Diff two versions:

GET /v1/templates/tpl_contract_summary_v3/versions/compare?from=3.2.1&to=3.3.0

Variable Injection

Pass template variables at inference time instead of embedding raw prompts:

{
  "template_id": "tpl_contract_summary_v3",
  "template_variables": {
    "focus_area": "termination clauses",
    "document": "..."
  },
  "project_id": "prj_legal_001",
  "model": "auto"
}

Missing required variables return HTTP 400 with error.code: template_variable_missing. Unknown variables are rejected unless allow_extra_variables: true is set on the template.

List and Retrieve

GET /v1/templates?project_id=prj_legal_001
GET /v1/templates/tpl_contract_summary_v3

List responses paginate with starting_after cursors. Each entry includes latest published version and draft status if one exists.

Governance Integration

Template publishes emit audit events (template.publish) visible in the governance audit log. Budget and rate-limit policies apply to template-backed inference identically to free-form prompts. Semantic cache keys include template_version so prompt refactors do not serve stale policy language.

Error Codes

HTTPCodeMeaning
400template_variable_missingRequired variable not supplied
404template_not_foundUnknown template ID
409template_version_conflictVersion already published
403insufficient_scopeMissing templates:manage

See Inference for calling templates from the core endpoint, Evaluations for promotion gates, and Semantic Caching for cache interaction with template versions.

Production API credentials are issued with an institution workspace. Contact sales if you need access.