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.0Key Endpoints
GET/api/healthServer liveness checkPOST/api/sessionsCreate a new sessionPOST/api/sessions/{id}/messagesSend prompt (SSE stream)GET/api/sessions/{id}/turnsList turns with metadataPOST/api/tasksStart a background taskGET/api/tasks/{id}/eventsSSE event stream for a taskGET/api/config/rolesList agent rolesPOST/api/credentialsSet a credentialStart 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();