Skip to main content

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.
Models can be customized via config/openai_models.yaml. See the Shannon configuration documentation for details on adding custom models.

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

Non-streaming requests have a 35-minute timeout to accommodate deep research and long-running workflows. For very long tasks, prefer streaming mode.

Streaming Response

When stream: true, the response is delivered as Server-Sent Events: First chunk (includes role):
Content chunks:
Final chunk (with finish reason):
Stream terminator:
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 a shannon_events field. This field carries agent lifecycle events that provide visibility into what Shannon’s agents are doing behind the scenes.
ShannonEvent fields: Forwarded event types:
Standard OpenAI clients ignore unknown fields, so the shannon_events field is safe to use with any OpenAI-compatible tooling. Parse it when you want richer progress information.

X-Session-ID Header

Shannon supports multi-turn conversations via the X-Session-ID request header. When provided, Shannon maintains conversation context across requests.
If no 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
Rate limit headers included in every response:

Error Handling

Errors follow the OpenAI error response format:
Error types:

List Models

GET /v1/models

Returns all available Shannon models.
Response:

GET /v1/models/

Returns details for a specific model. The model description is included in the X-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 the shannon_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:
The messages[].content field only accepts plain text strings. Multipart content (arrays with image_url objects) is not supported.

Differences from Standard OpenAI API

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