Skip to main content

Base URL

Endpoints Summary

Shannon provides 40+ REST endpoints across 8 categories:

Task Operations (10 endpoints)

Streaming (2 endpoints)

Session Management (6 endpoints)

Schedules (8 endpoints)

Authentication (8 endpoints)

Approvals & HITL Review (3 endpoints)

OpenAI Compatible (3 endpoints)

Health & Observability (3 endpoints)

Authentication

Development: Authentication is disabled by default (GATEWAY_SKIP_AUTH=1).Production: Set GATEWAY_SKIP_AUTH=0 and use API keys.

API Key Header

SSE Streaming Authentication

Browser EventSource cannot send custom headers. In production, proxy SSE via your backend and inject X-API-Key or Bearer headers. For SSE endpoints, the api_key query parameter is supported as a fallback (e.g., ?api_key=sk_...).

Common Headers

Request Headers

*Not required if GATEWAY_SKIP_AUTH=1

Response Headers

Rate Limiting

  • Default: 60 requests/minute per API key
  • Status: 429 Too Many Requests when exceeded
  • Header: Retry-After indicates seconds to wait

Idempotency

Prevent duplicate task submissions using Idempotency-Key header:
Behavior:
  • Same key within 24 hours returns cached response
  • Request body is ignored for duplicate keys
  • Uses Redis for distributed cache

Error Handling

HTTP Status Codes

Error Response Format

CORS

CORS is enabled for development:
Production: Configure Access-Control-Allow-Origin to specific domains.

Timeouts

Best Practices

1. Always Use Idempotency Keys

2. Implement Exponential Backoff

3. Stream Events for Long Tasks

4. Extract Workflow ID from Response

Quick Example

Next Steps

Submit Tasks

Task submission endpoint

Streaming

SSE and WebSocket streaming

Sessions

Session management

Python SDK

Use the Python SDK