---
title: "Generate AI draft for template (SSE streaming)"
method: POST
path: "/documents/templates/{id}/ai-draft"
tags: ["Documents"]
---

# Generate AI draft for template (SSE streaming)

`POST /documents/templates/{id}/ai-draft`

## Request

- Base URL: `https://hoghogh.ai/api/v1`
- URL: `https://hoghogh.ai/api/v1/documents/templates/{id}/ai-draft`
- Auth: HTTP bearer

## Path parameters

- `id` integer, required

## Request body

- object
  - `caseId` string, uuid
  - `context` string: Additional context for AI

## Response `200`

SSE stream of AI-generated text

## Other responses

- `402`: Subscription required for AI features

---

[API](https://skmtc.dev/hoghogh/apis/chistara-api.md) · [All operations](https://skmtc.dev/hoghogh/apis/chistara-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hoghogh/apis/chistara-api/revisions/457df37a06f7?raw)
