Docs / Prompt API
// MANAGED, VERSIONED, GOVERNED PROMPTS
Prompt API
Store prompts as versioned templates in the registry, then either compile them (Render) or compile-and-dispatch them (Completions). The difference matters: only Completions produces a verifiable receipt, because only Completions actually called a model.
Render vs. Completions
Two endpoints, one template. They look similar and do very different things.
Compiles the named template version with your variables and returns the resolved messages. No model is called, so there is no receipt. Use it to preview, to lint, or to feed the messages into your own pipeline.
Renders the template and dispatches it through the gateway — routing, guardrails, budget, and a billable=true receipt. The receipt's inputs_hash covers the fully-rendered messages, so the exact prompt that ran is provable without storing its text.
Templates, variables & partials
Templates use a simple {{ variable }} syntax with reusable {{> partial }} includes. Variables are typed; a missing required variable fails the render rather than silently producing an empty string.
curl https://agentics.you/api/v1/prompts/support-reply/completions \
-H "Authorization: Bearer ak_…" \
-d '{
"version": "label:production",
"variables": { "ticket": "#4821", "tone": "concise" },
"model": "@anthropic/claude-opus-4-8"
}'
# response carries x-agentics-receipt: <receipt_hash> — verify it.Versions & labels
Every saved edit is an immutable version. You dispatch against a version two ways:
- Pinned —
"version": "v7". Exactly that text, forever. - Labelled —
"version": "label:production". A moving pointer you repoint when you promote a new version.
| Field | Type | Meaning |
|---|---|---|
| id | string | Stable prompt identifier. |
| version | string | vN (pinned) or label:<name> (moving pointer). |
| prompt_version_id | hex | Recorded on the receipt — the exact version that produced the dispatch. |
| labels | string[] | e.g. production, staging. Repointing a label is an audited event. |
production writes an audit-log entry — who, when, from which version to which. Combined with the per-receipt prompt_version_id, you can prove which prompt text was live for any past request.