Skip to main content

Overview

The Playground API provides endpoints for managing chat sessions, sending messages, and retrieving observability data. All endpoints (except health) require JWT authentication.

Base URL

Authentication

All endpoints except /api/playground/health require JWT authentication:

Health Endpoints

GET /api/playground/health

Health check endpoint (no authentication required). Response:
Status Codes:
Success
Service is healthy
Service Unavailable
One or more dependencies are unhealthy

Session Endpoints

POST /api/playground/sessions

Create a new chat session.
string
Display name for the session (optional)
object
Custom metadata to attach to the session (optional)
Request:
Response:
Status Codes:
Created
Session created successfully
Unauthorized
Invalid or missing authentication token

GET /api/playground/sessions

List all sessions for the authenticated user.
integer
default:"20"
Maximum number of sessions to return
integer
default:"0"
Number of sessions to skip for pagination
Request:
Response:

GET /api/playground/sessions/

Get details for a specific session including message history. Path Parameters:
string
required
The session ID
Request:
Response:
Status Codes:
Success
Session retrieved successfully
Not Found
Session does not exist or user lacks access

DELETE /api/playground/sessions/

Delete a session and all its messages. Request:
Response:
Status Codes:
No Content
Session deleted successfully
Not Found
Session does not exist

Chat Endpoints

POST /api/playground/chat

Send a message and receive a response.
string
required
The session ID to send the message to
string
required
The user’s message content
boolean
default:"false"
Enable streaming response (SSE)
Request (Non-Streaming):
Response:
Request (Streaming):
Streaming Response (SSE):
Status Codes:
Success
Message processed successfully
Bad Request
Invalid request body
Not Found
Session does not exist

Observability Endpoints

GET /api/playground/observability/traces

Get OpenTelemetry traces for a session.
string
required
Filter traces by session ID
integer
default:"50"
Maximum number of traces to return
Request:
Response:

GET /api/playground/observability/logs

Get structured logs for a session.
string
required
Filter logs by session ID
string
default:"INFO"
Minimum log level (DEBUG, INFO, WARN, ERROR)
Request:
Response:

GET /api/playground/observability/metrics

Get metrics for a session. Request:
Response:

WebSocket API

WS /ws/playground/

Real-time bidirectional chat using WebSocket. Connection:
Message Types:
Example Session:

Error Responses

All endpoints may return the following errors:

401 Unauthorized

403 Forbidden

404 Not Found

429 Too Many Requests

500 Internal Server Error


SDK Examples

Python

JavaScript/TypeScript


Playground Guide

Learn how to use the playground

Authentication API

Authentication endpoints

MCP Protocol

MCP message format

Observability

Set up monitoring

Full API access! Use these endpoints to build custom integrations with the Interactive Playground.