AI API
AI behaviour is split across multiple endpoints to keep responsibilities clear, prompts focused, and quotas enforceable per feature.
All AI endpoints require:
- A valid authenticated session
- Passing the per-user rate limit check
- Passing the monthly AI credit quota check
A 429 response is returned when either check fails.
Board chat
POST /api/canvas/chat
Tool-calling board-level AI chat. Streams a UIMessage response that may include tool calls (createNote, updateNote, deleteNote, expandNote, summarizeBoard, createPlaceholderNote).
Key request fields: boardId, messages, boardState
Output: SSE stream (toUIMessageStreamResponse)
Subagent chat
POST /api/canvas/subagent
Dedicated AI assistant with phase-aware context. Same 6 tools as board chat. Every response ends with a fenced JSON block containing 3 suggested next actions.
Key request fields: boardId, messages, boardState, currentPhase
Output: SSE stream
Note AI (free-form)
POST /api/canvas/note-ai
Free-form per-note authoring. Agentic loop (up to 6 steps). May call searchNotes, readNote, loadSkill, delegateToProgrammer tools.
Key request fields: boardId, noteId, prompt, noteContent, allNotes
Output: Plain text stream (TITLE: ...\n---\n{body})
Note AI (slash command)
POST /api/canvas/note-ai/{command}
Slash-command variant. Uses a skill-specific system prompt. Returns 400 with available command list if {command} is unrecognised.
Available commands: generate-prd, generate-epic, generate-story, generate-decision, generate-feedback, generate-dev-task, generate-qa-test
Output: Plain text stream
Generate frontmatter
POST /api/canvas/generate-frontmatter
Generates a note's description and relationships metadata. Fire-and-forget — called after note AI generation completes.
Output: JSON object { description, relationships }
Document-to-notes
POST /api/canvas/document-to-notes
Converts extracted document text into 1–15 structured note suggestions.
Key request fields: text (max 100,000 chars), filename
Output: JSON { notes: [{ title, content, suggestedColor, suggestedType }] }
Notes analyze
POST /api/canvas/notes/analyze
AI analysis of a sticky note for improvement suggestions.
Output: JSON { suggestions: [{ sectionText, advice, actions }] }
Notes rewrite
POST /api/canvas/notes/rewrite
Field-level AI rewrite for note content. Board owner is charged for AI credits.
Output: JSON { rewritten: string }
Jira generate
POST /api/canvas/jira/generate
Step-by-step work item generation. Three modes: generate_step, regenerate_items, generate_children. Max duration: 60 seconds.
Output: JSON { items: [...], recommendedNextStep }
Jira analyze
POST /api/canvas/jira/analyze
AI analysis of a single work item for inline suggestions.
Output: JSON { suggestions: [{ sectionText, advice, actions }] }
Jira rewrite
POST /api/canvas/jira/rewrite
Field-level AI rewrite for a work item field or selected text.
Output: JSON { rewritten: string }
See also
- AI Overview — Safety principles and model details
- Board Chat — Board chat detailed behaviour
- Jira AI — Jira AI generation workflow