Overview
Shannon exposes an OpenAI-compatible API layer that lets you use existing OpenAI SDKs, tools, and integrations to interact with Shannon’s agent orchestration platform. The compatibility layer translates OpenAI chat completion requests into Shannon tasks and streams the results back in OpenAI format. This means you can point the OpenAI Python or Node.js SDK at Shannon and get access to multi-agent research, tool use, and deep analysis — all through a familiar interface.The OpenAI-compatible API is designed for compatibility with existing tooling. For full Shannon features (skills, session workspaces, research strategies, task control), use the native
/api/v1/tasks endpoints.Endpoints
Base URL:
http://localhost:8080 (development)
Authentication
The OpenAI-compatible endpoints use the same authentication as other Shannon APIs.Development Default: Authentication is disabled when
GATEWAY_SKIP_AUTH=1 is set. Enable authentication for production deployments.Available Models
Shannon maps model names to different workflow modes and strategies. Select a model to control how your request is processed.
If no model is specified,
shannon-chat is used.
Shannon Cloud Only: The
shannon-ads-research model is an enterprise feature available only on Shannon Cloud deployments with ads research vendor adapters configured.Chat Completions
POST /v1/chat/completions
Request Body
Message Object:
Stream Options:
How Messages Are Processed
Shannon translates the OpenAI messages array into a Shannon task:- Last user message becomes the task query
- First system message becomes the system prompt
- All other messages (excluding system and last user) become conversation history
- The model name determines the workflow mode and research strategy
Non-Streaming Response
Streaming Response
Whenstream: true, the response is delivered as Server-Sent Events:
First chunk (includes role):
Usage data in the final chunk is only included when
stream_options.include_usage is set to true.Shannon Extensions
shannon_events Field
During streaming, Shannon extends the standard OpenAI chunk format with ashannon_events field. This field carries agent lifecycle events that provide visibility into what Shannon’s agents are doing behind the scenes.
Forwarded event types:
X-Session-ID Header
Shannon supports multi-turn conversations via theX-Session-ID request header. When provided, Shannon maintains conversation context across requests.
X-Session-ID is provided, Shannon derives a session ID from the conversation content (hash of system message + first user message) or from the user field.
The response includes X-Session-ID and X-Shannon-Session-ID headers when a new session is created or a collision is detected.
Rate Limiting
Rate limits are enforced per API key, per model. The default limits are:- 60 requests per minute per model
- 200,000 tokens per minute per model
Error Handling
Errors follow the OpenAI error response format:List Models
GET /v1/models
Returns all available Shannon models.GET /v1/models/
Returns details for a specific model. The model description is included in theX-Model-Description response header.
Usage with OpenAI SDKs
Python
Node.js / TypeScript
curl
Streaming with Shannon Events
To build rich UIs that show agent progress, parse theshannon_events field from streaming chunks:
Heartbeat and Keepalive
During streaming, Shannon sends SSE comment lines (: keepalive) every 30 seconds to keep the connection alive. Conforming SSE clients ignore these automatically. This prevents load balancers and proxies from closing idle connections during long-running research tasks.
Limitations
The following OpenAI API features are not supported:Differences from Standard OpenAI API
Related
Submit Tasks (Native API)
Full Shannon task submission with all features
Event Streaming
Shannon’s native SSE and WebSocket streaming
Event Types Reference
Complete list of Shannon event types
Python SDK
Shannon’s native Python client