Docs / API Reference

API Reference

Complete REST API for managing conversations, plans, jobs, and integrations.

Base URL is https://localhost:5173/api (port configurable via the TALKIE_PORT environment variable). All responses are JSON unless otherwise noted. SSE endpoints return text/event-stream.

Self-signed certificates Talkie uses self-signed HTTPS certificates. When making requests with curl or other HTTP clients, you will need to pass the --insecure flag (or equivalent) to skip certificate verification.

Status & Health

GET /api/status

Health check. Returns the current avatar state, active conversation ID, and database connection status.

GET /api/integrations

Returns the status of MCP server and Telegram bot integrations, including whether each is connected and active.

Conversations

GET /api/conversations

List all conversations. Supports limit and offset query parameters for pagination.

POST /api/conversations

Create a new conversation. Body: { "title": "string" }

GET /api/conversations/:id

Get a single conversation with all its messages and activities included.

PATCH /api/conversations/:id

Update a conversation. Body: { "title": "string", "parent_id": "string", "project_id": "string" }

DELETE /api/conversations/:id

Delete a conversation and all its associated messages, activities, and images.

GET /api/conversations/:id/liner-notes

Get the liner notes text for a conversation.

PUT /api/conversations/:id/liner-notes

Save liner notes for a conversation. Body: { "notes": "string" }

POST /api/conversations/:id/messages

Add a message to a conversation. Body: { "role": "user|assistant", "content": "string", "images": [], "activities": [] }

PATCH /api/images/:id

Update the description of an attached image. Body: { "description": "string" }

Plans

GET /api/plans

List all plans. Supports status and conversation_id query parameters for filtering.

GET /api/plans/:id

Get a single plan by ID.

POST /api/plans

Create a new plan. Body: { "title": "string", "content": "string", "status": "draft|approved|in_progress|completed|archived", "conversation_id": "string" }

PUT /api/plans/:id

Update an existing plan. Body: { "title": "string", "content": "string", "status": "draft|approved|in_progress|completed|archived" }

DELETE /api/plans/:id

Delete a plan by ID.

Jobs

GET /api/jobs

List all jobs. Supports status query parameter for filtering (queued, running, completed, failed, cancelled).

POST /api/jobs

Create a new background job. Body: { "conversation_id": "string", "prompt": "string" }

GET /api/jobs/:id

Get the status and result of a job by ID.

GET /api/jobs/:id/stream

SSE stream for real-time job events. Returns text/event-stream with JSON-encoded events as the job progresses.

DELETE /api/jobs/:id

Cancel a running job by ID.

GET /api/search

Full-text search across all conversations. Query parameters: q (search query, required), limit (max results). Returns snippets with highlighted matches.

IPC

The IPC (Inter-Process Communication) endpoints enable communication between the Talkie frontend and external tools like the MCP server. The frontend posts messages, and MCP tools poll for pending messages and respond.

GET /api/pending

Check for a pending message from the frontend. Returns the message content if one is waiting, or an empty response if not.

POST /api/respond

Send an IPC response back to the frontend. Body: { "content": "string" }

POST /api/send

Send a message and wait for a response via SSE. Body: { "content": "string", "conversation_id": "string" }. Returns a text/event-stream with the response.

Sessions

GET /api/session

Get the currently connected Claude Code session ID.

POST /api/session

Set the Claude Code session ID to connect Talkie to a running session. Body: { "sessionId": "string" }

DELETE /api/session

Clear the connected Claude Code session.

Claude Code

POST /api/claude-code

Spawn a fresh claude -p CLI process and stream the response as SSE. Body: { "prompt": "string", "conversation_id": "string", "images": [] }. Returns a stream of JSON events with types: assistant (text chunks), activity (tool usage), result (final response), and error.

One-shot processes Each request to /api/claude-code spawns a fresh CLI process with the flags --no-session-persistence and --permission-mode bypassPermissions. There is no persistent session between requests.

Media

POST /api/analyze-image

Analyze an image using Claude vision via the Anthropic API key. Body: image data URL (base64-encoded).

POST /api/analyze-image-cc

Analyze an image using Claude vision via the Claude Code CLI. Same input format as the API key variant, but routes through the CLI.

POST /api/open-url

Open a URL in the default system browser. Body: { "url": "string" }

Migration

POST /api/migrate

Import conversations from localStorage format into the SQLite database. Used for migrating data from older versions of Talkie that stored conversations in the browser.

Examples

Create a new conversation using curl:

curl -X POST https://localhost:5173/api/conversations \
  -H "Content-Type: application/json" \
  -d '{"title": "My First Tape"}' \
  --insecure

The --insecure flag is needed because Talkie uses self-signed certificates. In production HTTP clients, you would configure the CA certificate or disable verification as appropriate for your environment.

List all conversations with pagination:

curl https://localhost:5173/api/conversations?limit=10&offset=0 \
  --insecure

Search across all messages:

curl "https://localhost:5173/api/search?q=cassette&limit=5" \
  --insecure

Create a background job:

curl -X POST https://localhost:5173/api/jobs \
  -H "Content-Type: application/json" \
  -d '{"conversation_id": "abc-123", "prompt": "Summarize this conversation"}' \
  --insecure

Stream Claude Code output with SSE:

curl -N -X POST https://localhost:5173/api/claude-code \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello, Claude!", "conversation_id": "abc-123"}' \
  --insecure
Tip Use the -N flag with curl to disable output buffering when streaming SSE endpoints. This ensures events are printed as they arrive.