Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/v1/co_writer/edit | Edit text with an AI instruction |
POST | /api/v1/co_writer/automark | Auto-annotate text |
GET | /api/v1/co_writer/history | List all edit operations |
GET | /api/v1/co_writer/history/{operation_id} | Get a single operation |
GET | /api/v1/co_writer/tool_calls/{operation_id} | Get tool call details for an operation |
POST | /api/v1/co_writer/export/markdown | Export content as a Markdown file |
POST | /api/v1/co_writer/narrate | Generate a narration script with optional TTS audio |
POST | /api/v1/co_writer/narrate/script | Generate a narration script only |
GET | /api/v1/co_writer/tts/status | Check TTS service availability |
GET | /api/v1/co_writer/tts/voices | List available TTS voices |
POST /api/v1/co_writer/edit
Edit a piece of text according to an instruction. The agent can optionally query a knowledge base or the web to ground its edits.
Request body
The text to edit.
Natural-language instruction describing the desired edit, e.g.
"Make this more concise".Edit action. One of
"rewrite", "shorten", or "expand".Optional grounding source. One of
"rag" (knowledge base) or "web". Omit to edit without external context.Knowledge base to use when
source is "rag".Response
The edited version of the input text.
Unique identifier for this edit operation. Use with the history endpoints.
POST /api/v1/co_writer/automark
Automatically detect and annotate important terms, concepts, or entities in the text.
Request body
The text to annotate.
Response
The annotated text with highlights or markup applied.
Unique identifier for this operation.
GET /api/v1/co_writer/history
List all past edit and annotation operations.
Array of operation records.
Total number of operations.
GET /api/v1/co_writer/history/{operation_id}
Get detailed information about a single operation.
Operation identifier.
404 if the operation is not found.
GET /api/v1/co_writer/tool_calls/{operation_id}
Get the raw tool call log for an operation, including all LLM tool invocations made during editing.
Operation identifier.
404 if no tool calls are recorded for this operation.
POST /api/v1/co_writer/export/markdown
Download the current document content as a .md file.
Request body
Markdown content to export.
Filename for the downloaded file.
Content-Type: text/markdown.
POST /api/v1/co_writer/narrate
Generate a narration script from note content and optionally synthesize it into audio using TTS.
Request body
The note or document content to narrate.
Narration style. One of:
"friendly"— Warm, approachable tutor style."academic"— Rigorous academic lecture style."concise"— Efficient, minimal knowledge delivery.
TTS voice to use. One of
"alloy", "echo", "fable", "onyx", "nova", "shimmer". Defaults to the configured TTS default.Set to
true to return only the script without generating audio.Response
The generated narration script.
Key points extracted from the content.
The narration style used.
Character count of the input content.
Character count of the generated script.
Whether an audio file was generated.
URL to the generated audio file.
null if skip_audio was true or TTS failed.Identifier for the audio file.
null if not generated.Voice used for TTS.
null if not generated.Error message if audio generation failed but the script was still returned.
POST /api/v1/co_writer/narrate/script
Generate a narration script without audio. Faster than the full /narrate endpoint.
Request body
The note or document content to narrate.
Narration style:
"friendly", "academic", or "concise".