> ## 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.

# Text Generation

> Updates and improvements to Corti AI Text Generation functionality

<Update label="2026-06-18" tags={["Templates", "Sections", "API", "Beta"]}>
  #### Template & Section resource ownership & permissions <Badge className="accent-badge" shape="rounded">Beta</Badge>

  This release builds onto the new Guided Sections & Templates APIs and resources and adds support for the management of these resources across API, Console and Embedded Assistant.

  * Templates & Sections created via an API Client configured with Client Credentials are shared resources within a Console project
  * Any API Client with direct access configured (e.g. Client Credentials) within the same Console Project has full Read + Write access
  * API Clients with delegated access (e.g. ROPC of PKCE setup for embedded Assistant) within the same Console Project can delegate read access as follows:
  * Read access for individual end users can be managed further by assigning templates & sections to specific Console Customers that can represent any group of users (e.g. customer, department, test user group)

  Corti-provided default sections remain available for Read-access alongside your custom resources. The LIST /templates and LIST /sections endpoints come with various query params, including flexible structured labels, you can leverage to filter & control access in your client application when integrating purely via API.

  Read more in the guide: [Manage Access](/textgen/console-templates/manage-library#manage-access).
</Update>

<Update label="2026-05-28" tags={["Templates", "Sections", "API", "Beta"]}>
  #### New: Bring-your-own prompts — create sections & templates via API <Badge className="accent-badge" shape="rounded">Beta</Badge>

  Sections and templates are now **first-class citizens in the API**, empowering you to create all aspects of sections and templates — including their prompts — directly via API. The new `/documents/sections` and `/documents/templates` endpoints let you author, version and publish your own resources, then reference a template or assemble sections directly to generate a document.

  * **Define every aspect of a section.** Content instructions, context, writing style, plus a powerful new way to handle formatting that combines presets (list, paragraph, subheadings) with flexible customization options via the typed `outputSchema` (`string`, `number`, `boolean`, `array`, `object`).
  * **Compose templates from sections.** A template adds top-level instructions and references published sections by UUID with an explicit order.
  * **API-first by design.** You steer the section-specific prompts while Corti ensures the overall system prompts for document generation and guardrails continue to play nicely together.
  * **Versioning & publishing.** Iterate freely via `POST .../versions`; previously published versions stay live until you explicitly publish a new one. Inherit from any existing section or template via `inheritFromId` — your inheriting resource keeps tracking future Corti improvements on fields you don't override.

  This unlocks template management surfaces for your admins and lets you expose end-user customization options inside your own solution. Corti-provided default sections remain available alongside your custom resources.

  Read more in the new guides: [Create a Section](/textgen/section-creation) and [Create a Template](/textgen/template-creation).
</Update>

<Update label="2026-05-28" tags={["Documents", "API", "Beta"]}>
  #### New: Guided Clinical Synthesis — POST /documents <Badge className="accent-badge" shape="rounded">Beta</Badge>

  Guided Clinical Synthesis transforms transcripts, extracted facts and documents into **precise, structured and schema-controlled clinical documentation outputs**. Instead of relying on the LLM to handle both content and formatting simultaneously, guided synthesis separates these concerns and enables schema-defined structured outputs — defined when you author your sections via the new [bring-your-own-prompts API](/textgen/section-creation).

  The new `POST /documents` endpoint accepts four template-supply paths in a single, consistent request shape:

  1. **Plain `templateRef`** — reference a stored template (optionally pin a version). Lightest path, no side-effects, ideal for production traffic.
  2. **`templateRef` with runtime overrides** — keep your base template and patch a section's title, instructions or output schema for a single call. A drift-proof, auto-generated template aggregate is persisted with `inheritedFromId` pointing at the base.
  3. **Assembly from stored sections** — pick the sections you want, in declaration order, and assemble a template on the fly. The resulting aggregate is saved so you can reuse it.
  4. **Fully inline dynamic template** — define the template and every section inline. Sections and the wrapping template are persisted for 30 days as drift-proof snapshots or "receipts" you can turn into permanent resources.

  **Flexible context input.** Unlike Classic — which accepts **exactly one** `context.type` per call (facts *or* transcript *or* string, never mixed) — Guided lets you pick **exactly one** of two input modes per call:

  * **`context` array** — combine context types in one call, e.g. a referral letter as `text` + a `transcript` of the live consultation + a few pre-chart `facts` items, all shipped to the LLM together. (Classic could not mix types like this.)
  * **`interactionId`** — let the API pull all non-discarded facts and transcripts already attached to that interaction implicitly. No manual context wiring.

  `context` and `interactionId` are mutually exclusive today. Coming soon: passing both in the same call to constrain or extend the interaction-attached context with extra explicit items.

  **Outcomes**

  * **For clinical notes**, this reduces formatting inconsistencies and improves output quality for multi-section documents.
  * **For advanced use cases**, structured, typed outputs unlock much more control over downstream usage — think field-level documentation, structured data pipelines and clinical decision support.
  * **Drift-proof outputs** — every path except plain `templateRef` snapshots the fully resolved template at request time; subsequent edits to base resources do not affect previously generated documents.

  Read more in the [Guided Synthesis guide](/textgen/documents-guided-synthesis).
</Update>

<Update label="2026-05-28" tags={["Templates", "Sections", "Beta"]}>
  #### New: Foundation for template ownership & permissions <Badge className="accent-badge" shape="rounded">Beta</Badge>

  This release lays the groundwork for **template ownership & permissions** — controls that ultimately separate personal templates (user-created, user-scoped) from organization-wide templates managed by admins, and from Corti-provided standard templates. Once fully released in Corti Console, organizations can distribute approved templates to their users while preventing unauthorized modifications — essential for maintaining consistency and compliance at scale.

  Available in this beta:

  * **Corti-provided standards as read-only resources.** Corti's curated sections and templates are returned in `LIST /documents/sections` and `LIST /documents/templates` with `source: corti` and cannot be mutated. Inherit from them via `inheritFromId` for specialty variants or organization-specific tweaks; future Corti improvements propagate automatically to fields you have not overridden.
  * **API-client–authored resources.** Sections and templates created by an API client are returned with `source: user` — they belong to the project in Corti Console that your API key is associated with. You hold write, version, publish and delete on these.
  * **Source-aware list responses.** Both list endpoints return your project's resources alongside Corti Standards in one response. Filter on the `source` field client-side (`corti` vs `user`) to scope a "browse" surface to the curated library or a "my organization" view.
  * **Server-side filters for narrowing the response.** `LIST /documents/sections` and `LIST /documents/templates` accept `lang` (BCP-47), `region` (ISO 3166-1 alpha-3), `specialty`, `label` (`key:value` format) and `published` — all repeatable. Use these to narrow by the dimensions your integration actually cares about.
  * **Labels for finer-grained distribution.** Apply `Label` objects (`{ key, value }`) to both sections and templates and pass them as `?label=customer:acme` on `LIST` calls — the building block for distributing approved templates to specific customers, departments or workflows at scale.

  Assigning your own template & section resources for read-access to other API keys or Customers created via Console is coming soon.
</Update>

<Update label="2026-05-07" tags={["API", "FactsR"]}>
  #### Support for `flush` and `factGenerationInterval` <Badge className="accent-badge" shape="rounded">Beta</Badge>

  The `/streams` endpoint now supports parameters and event types that add more control to generating facts.

  The [`flush`](/api-reference/streams#flush-the-audio-buffer) event is now also respected for fact generation. When sent from the client, this first processes outstanding transcripts and subsequently triggers fact generation.

  The [`factGenerationInterval`](/api-reference/streams#param-fact-generation-interval) parameter can be optionally set to `fast_init`, else default to the fixed 60s interval. With `fast_init`, fact generation will follow a logarithmic curve, currently with the initial generation at roughly around 10s, then 20s, then 26s and continuously increasing interval length until the default 60s interval is reached.

  Note: Both functionalities carry the <Badge className="accent-badge" shape="rounded">Beta</Badge>. There can be effects on fact (near) duplicates and quantity.
</Update>

<Update label="2026-01-19" tags={["API"]}>
  #### Updates: More Descriptive Error Codes

  Error codes now return clearer, more descriptive details to make it easier to identify the issue. This effectively replaces the previous format and deprecates the Common Errors.

  Here is the schema which you can also see in the API reference responses, along with a couple examples.

  <CodeGroup>
    ```bash response error schema theme={null}
    {
    "requestid": "<string>",
    "status": 123,
    "type": "<string>",
    "detail": "<string>",
    "validationErrors": [
      {}
    ]
    }
    ```

    ```bash example 400 response theme={null}
    {
        "requestid": "b0dd76dd-7bc6-4aba-8dc1-efd841060067",
        "status": 400,
        "type": "about:blank",
        "detail": "Validation error",
        "validationErrors": [
            {
                "detail": "must be a valid BCP-47 language tag",
                "pointer": ".outputLanguage"
            }
        ]
    }  
    ```

    ```bash example 404 response theme={null}
    {
        "requestid": "b39b3686-0829-428e-b5e6-1be90214cb3c",
        "status": 404,
        "type": "about:blank",
        "detail": "template not found"
    }
    ```
  </CodeGroup>
</Update>

<Update label="2026-01-15" tags={["Documents"]}>
  #### Updates: Standard Templates and Sections

  Corti standard templates and sections have undergone various improvements to increase the quality of the documentation to be generated and support the new [`documentation mode`](/textgen/documents-docmode). We have added a few additional standard sections for referral or discharge summary, while streamlining some sections, e.g. there is now only one section for social history and it includes alcohol and nicotine by default. If you don't want this to be included, you can customize the section accordingly. Read more on customizing sections [here](/textgen/documents-customize).

  <Info>Should you for some reason still need to reference the previous iteration of the standard sections or templates, then those are all available with the post-fix `-legacy` to the section and template key.</Info>

  Read more in our [guide on templates](/textgen/templates-standard).
</Update>

<Update label="2026-01-07" tags={["Documents", "API"]}>
  #### New: Documentation Modes

  You can now set `documentationMode: routed_parallel` and leverage the innovative, reconceptualized approach to generate documents for faster, more consistent and robust outputs. This 2-step, coarse-to-fine document generation mode currently supports FactsR as input and in the first step distributes the relevant facts to each section, based on the specified template (sections), then generates each section in parallel.

  This new documentation mode requires the template and its sections to support `routed_parallel`. You can check the new property of the same name `documentationMode` for responses from [GET /template(s)](/api-reference/templates/get-template#response-documentation-mode) and [GET /templateSections](/api-reference/templates/list-template-sections#response-data-items-documentation-mode).

  Read more in our [guide on Documentation Mode](/textgen/documents-docmode) or see the [API reference](/api-reference/documents/generate-document#body-one-of-0-documentation-mode).
</Update>

<Update label="2025-12-12" tags={["Documents", "API"]}>
  #### New: Customize existing sections

  Empower your customers and end-user clinicians to combine and tailor the Corti provided template sections for custom templating needs. Built atop the ability to reference section keys dynamically in the API request, you can now directly in the request override section names, writing styles, formatting rules and additional instructions, ensuring documentation perfectly fits organizational standards and clinician preferences.
  Read more in the [guide to customize sections](/textgen/documents-customize) or see the [API reference](/api-reference/documents/generate-document#sections-overridable)
</Update>

<Update label="2025-11-13" tags={["Documents", "API"]}>
  #### Changes and deprecations to document and template endpoints

  As we evolve the document generation endpoint and related GET templates/sections, we are announcing several changes and deprecations.
  Find the full details including impact and timeline to shutdown in the [breaking changes changelog](/release-notes/changelog-upcoming)
</Update>

<Update label="2025-11-05" tags={["Documents", "LLM", "API"]}>
  #### New, improved documentation guardrails!

  * We have re-architected our documentation guardrails to be faster and more accurate.
  * Documentation guardrails are the by default automatic step that quality-controls the generated document to correct outputs ungrounded in the source input.
  * In this re-architected, new approach, we in parallel for each section identify hallucinations and provide targeted fixes by reference (sentence/segment index), preventing mismatched edits and skipping ambiguous duplicates. The result is format-preserving precise, auditable corrections that deliver safer, more trustworthy clinical summaries.

  Additionally, you can now at request level [disable documentation guardrails](/api-reference/documents/generate-document#body-disable-guardrails) if you want to better understand their impact on quality, processing time and token usage.

  #### Reduced token usage for text generation

  We are now leveraging cached input tokens when generating documents or facts. This is part of a continuous effort to provide text gen capabilities by Corti's LLMs at even more competitive token consumption behaviour. <br /><br />
  *Note: We plan to expose cached tokens as separate usage info response in the future.*
</Update>

<Update label="2025-10-10" tags={["FactsR", "API"]}>
  #### New endpoint to [extract facts](/api-reference/facts/extract-facts) from a provided text string input now available!

  * so far [FactsR™](/textgen/factsr) was dependent on streaming audio over WSS to extract facts
  * this new endpoint facilitates a REST endpoint as alternative to extract facts

  The endpoint lives under the new /tools/ route:

  * atomic endpoint, not part of interaction collection
  * output is not stored into Corti database (zeroRetention is the only default)

  Read more about the behaviour and use cases of this endpoint in our [guide](/textgen/factsr).
</Update>

<Update label="2025-10-01" tags={["Documents"]}>
  Update to [Generate Document](/api-reference/documents/generate-document) functionality, including the following:

  * Improve handling of sections that do not have content generated so that an empty string is returned instead of a placeholder (e.g., `<empty>`).
  * Fix to issue causing json text to be included in note output.
  * nfc: Improve logging and exception handling in LLM hallucination guardrails service.
</Update>

<Update label="2025-09-05" tags={["API", "Documents"]}>
  New: Set a [zeroRetention header](/api-reference/documents/generate-document#parameter-x-corti-retention-policy) in the request to disable storing of the generated document to the DB.
</Update>

<Update label="2025-09-22" tags={["API"]}>
  Updated endpoint tags in [API Reference](/api-reference/welcome) page to indicate those with limited availability (codes, alignment, classification, contextual, explainability). Endpoints labeled as `limited availability` are *not available* for public use at this time. Please [contact us](https://help.corti.app) to learn more about these expert models and expected functionality to be generally released as AI tools.
</Update>

<Update label="2025-06-11" tags={["FactsR", "LLM"]}>
  #### Introducing a new foundation for clinical AI, built not just to document care, but to support it: FactsR™.

  FactsR listens in real time, extracts clinical facts as the conversation unfolds, and helps clinicians stay in control, refining and approving facts, not sifting through hallucinated paragraphs.

  Read the full announcement [here](https://www.corti.ai/stories/introducing-factsr-the-thinking-engine-behind-better-clinical-ai)!
</Update>

<Update label="2025-05-15" tags={["Documents", "API"]}>
  #### New: Corti default templates

  Leverage default, out-of-the-box templates and sections to accelerate launching ambient documentation flows.
  The templates and sections cover a broad range of frequently used clinical note formats and are available in all languages Corti offers.
  New [API endpoints](/api-reference/documents/list-documents) to both list templates, sections and retrieve individual templates and sections are launched.

  Learn more how to leverage those templates [here](/textgen/templates-standard)!
</Update>

<Update label="2025-01-28">
  Announcing the launch of Corti AI Platform. Read more about it [here](https://www.corti.ai/)
</Update>
