Generate a structured document
Generates a structured document using one of three template-supply paths: a stored template reference (optionally with runtime overrides), an ad-hoc assembly of stored sections, or a fully inline dynamic template. Exactly one of templateRef, assemblyTemplate, or dynamicTemplate must be provided.
Context can combine different types or reference an interactionId to automatically fetch existing context to pass to the LLM. Note that discarded facts are not passed to the LLM.
With the exception of the plain templateRef path (no overrides), every call creates a new auto-generated template aggregate that snapshots the resolved prompts as a drift-proof receipt, persisted for 30 days.
Documentation Index
Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Input your token
Headers
Identifies a distinct entity within Corti's multi-tenant system. Ensures correct routing and authentication of the request.
"base"
Pass the optional X-Corti-Retention-Policy: none header to generate and return the document without saving it to the database. The response will be 200 with EphemeralDocumentResponse. Without the header the document is saved and the response is 201 with CreateDocumentResponse.
none Body
- templateRef
- assemblyTemplate
- dynamicTemplate
Generate a document using a stored template. Optionally supply runtime overrides to patch instructions or sections without mutating the base template. At least one of context or interactionId must be supplied as input context for the model.
The language in which the document will be generated as a BCP 47 tag.
Reference an existing stored template, optionally with overrides.
Ordered list of context items the model reasons over. Each item is one of text, a transcript (with optional metadata and segments), or a single fact. Items are interleaved by timestamps where present on transcript segments; otherwise array order is preserved.
A freeform text snippet provided as input context to the model.
- ContextText
- ContextTranscript
- ContextFacts
When supplied, all facts and transcripts already attached to the referenced interaction are passed implicitly as input context. Facts with isDiscarded: true are not passed on.