VocalDocscontracts 1.65.0

Dry-run the composed request of an Agent version

POST /v1/agents/{agent_id}/versions/{version}/render

PropertyValue
Operationrender_agent_version_prompt
GroupAgent versions
Scopeprompts:read
Route classread
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditNot audited: A dry run: it changes no state and reads no Call content, so it writes no Audit event (ADR 0012, prompt-manager.md section 7).
Released in1.55.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Composes the request the Agent version sends for one model request, in the order of agent-runtime.md section 3.2: the platform base it tracks or pins, the Organization layer it receives, its Agent layer (its template or its inline instructions), then the synthetic directive and context entries of the body, and answers every section with its token estimate, the stable prefix, the names of missing values and the lint cross-checks of its publish (1.55.0). It writes nothing: no Call, Audit or Usage event.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the prompts:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/agents/agt_.../versions/1/render" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
agent_idpathAgentIdyesThe id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
versionpathintegeryesA version number, from 1.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: AgentPromptRenderRequest.

FieldTypeRequiredDescription
callPromptRenderCallInputno
constantsmap of PromptConstantValuenoOrganization constants for this render; those of the Organization layer the render resolves when omitted. display_name is the Organization name.
contextarray of PromptContextEntryInputno
directivestringnoA synthetic directive slot, as rewrite_instruction would set it.
retrievalmap of booleannoWhether each Knowledge binding returned passages for this request, by handle: true renders the first branch of its retrieval slot, false or absent the second.
slotsmap of PromptSlotValuenoSynthetic slot values; an unset slot renders empty or its default().
statestringnoThe active state, the state root.
time_nowRequestTimestampnoThe time.now root; the request instant when omitted.
variablesmap of VariableValuenoSynthetic values of the declared variables. A value of an undeclared name is variable_unknown, of the wrong type variable_type; an optional variable without a value renders empty and is named in missing_values.
variantPromptVariantKeynoThe variant to compose; the model family of the version's primary model when omitted, which is default until the llm descriptors name their model family.

Responses

StatusContent typeShapeError codes
200application/jsonPromptRenderResult
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is PromptRenderResult.

FieldTypeRequiredDescription
lintarray of PromptLintFindingyesThe lint findings of what was rendered: the stored findings of a version, those of the draft, and for an Agent version the cross-checks of its publish.
missing_valuesarray of PromptValuePathyesThe paths that rendered empty for want of a value, such as variables.clinician_name (missing_value); names only, never a value.
object"prompt_render"yes
sectionsarray of PromptRenderSectionyesIn composition order.
stable_prefix_tokensintegeryesThe tokens before the first per-Call or per-Turn value, which a Provider that caches prompts may reuse between requests (prompt-manager.md section 4).
total_tokensintegeryes
variantPromptVariantKeyyes