Back to home
REST + SSE

Build on the Coqui API

A full HTTP API with real-time streaming via Server-Sent Events. Build dashboards, mobile apps, CI pipelines, or anything that talks HTTP.

Quick Start

Start the API server and connect from any language or tool:

# Start the API server
coqui --api

# Or with network access (connect from other devices)
coqui --api --host 0.0.0.0

Key Endpoints

GET/api/healthServer liveness check
POST/api/sessionsCreate a new session
POST/api/sessions/{id}/messagesSend prompt (SSE stream)
GET/api/sessions/{id}/turnsList turns with metadata
POST/api/tasksStart a background task
GET/api/tasks/{id}/eventsSSE event stream for a task
GET/api/config/rolesList agent roles
POST/api/credentialsSet a credential

Start the server with coqui --api and connect from any language.

Quick Example

const res = await fetch(
  '/api/sessions/abc/messages',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      message: 'Analyze composer.json',
    }),
  }
);

// Stream the response
const reader = res.body
  .getReader();