Introduction
Shannon provides HTTP REST and gRPC APIs for submitting tasks, streaming results, and managing AI agent workflows. Base URL:http://localhost:8080 (development)
Quick Start
API Endpoints
Core Task Operations
| Endpoint | Method | Description |
|---|---|---|
/api/v1/tasks | POST | Submit a new task |
/api/v1/tasks/stream | POST | Submit task and get stream URL (201) |
/api/v1/tasks | GET | List tasks with filters |
/api/v1/tasks/{id} | GET | Get task status and result |
/api/v1/tasks/{id}/events | GET | Get task event history |
/api/v1/tasks/{id}/timeline | GET | Get Temporal execution timeline |
Real-Time Streaming
| Endpoint | Method | Description |
|---|---|---|
/api/v1/stream/sse?workflow_id={id} | GET | Server-Sent Events stream |
/api/v1/stream/ws?workflow_id={id} | GET | WebSocket stream |
Session Management
| Endpoint | Method | Description |
|---|---|---|
/api/v1/sessions | GET | List sessions with pagination |
/api/v1/sessions/{sessionId} | GET | Get session details |
/api/v1/sessions/{sessionId}/history | GET | Get session chat history |
/api/v1/sessions/{sessionId}/events | GET | Get session events (grouped by turn) |
/api/v1/sessions/{sessionId} | PATCH | Update session title (UUID or external_id) |
/api/v1/sessions/{sessionId} | DELETE | Delete session (soft delete; 204 idempotent) |
Health & Observability
| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/health | GET | Health check | No |
/readiness | GET | Readiness probe | No |
/openapi.json | GET | OpenAPI 3.0 spec | No |
Authentication
Development Default: Authentication is disabled (
GATEWAY_SKIP_AUTH=1). Enable for production.SSE Streaming: Browser
EventSource cannot send custom headers.- Development: set
GATEWAY_SKIP_AUTH=1to skip auth. - Production: initiate SSE from your backend (or edge) and inject
X-API-KeyorAuthorization: Bearerheaders. - Do not pass API keys in URL query parameters.
Response Format
All endpoints return JSON with consistent error format: Success (200):Rate Limiting
- Default: 60 requests/minute per API key
- Headers:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset - 429 Response: Includes
Retry-Afterheader
Event Streaming
Shannon emits 26 event types for real-time monitoring: Core Events:WORKFLOW_STARTED,WORKFLOW_COMPLETEDAGENT_STARTED,AGENT_COMPLETEDSTATUS_UPDATE,DATA_PROCESSINGERROR_OCCURRED
LLM_PROMPT,LLM_OUTPUT,LLM_PARTIAL
TOOL_INVOKED,TOOL_OBSERVATION
EventType enum for filtering and checks. See SDK Streaming.
Client Access
Use the Gateway REST API or the Python SDK (HTTP-only):- REST endpoints:
http://localhost:8080/api/v1/* - Python SDK:
ShannonClient(base_url="http://localhost:8080")
Best Practices
1. Use Session IDs for Context
2. Stream Events for Long Tasks
3. Handle Rate Limits
4. Use Idempotency Keys
SDKs
Python SDK
Official Python client with streaming support
REST Clients
Use any HTTP client library