Shannon API
OpenAI & Anthropic compatible AI API with function calling, web search, and structured outputs.
Shannon AI API Documentation
Overview
Public docsEverything you need to ship with Shannon's OpenAI and Anthropic compatible API.
https://api.shannon-ai.com/v1/chat/completionsUse the Chat Completions API with function calling and streaming.
https://api.shannon-ai.com/v1/messagesClaude Messages format with tools and anthropic-version header.
Authorization: Bearer <your-key>Or X-API-Key with anthropic-version for Claude-style calls.
Public docs - Key required to callStreaming, function calling, structured outputs, web search.
- โSetupPoint your SDK at ShannonSet baseURL to the OpenAI or Anthropic endpoints above.
- โSecurityAttach your API keyUse Bearer tokens for OpenAI calls or X-API-Key + anthropic-version.
- โCapabilitiesEnable tools & structured outputsSupports OpenAI tools/functions, JSON schema, and built-in web_search.
- โAnalyticsTrack usageView token and search consumption on this page when signed in to your account.
Capabilities
OpenAI + AnthropicDrop-in replacement for OpenAI and Anthropic APIs with native support for tools, structured outputs, and built-in web search.
Drop-in Replacement
CompatibleWorks with OpenAI and Anthropic SDKs. Just change the base URL.
Function Calling
ToolsDefine tools, let Shannon call them. Supports auto, forced, and none modes.
Built-in Web Search
SearchReal-time web search with source citations. Automatically available.
Structured Outputs
JSONJSON mode and JSON Schema enforcement for reliable data extraction.
Multi-turn Tools
AgenticAutomatic function execution loops. Up to 10 iterations per request.
Streaming
FastServer-sent events for real-time token streaming.
Quick Start
5 minutesGet started in three steps. Shannon mirrors OpenAI and Anthropic clients.
Set your base URL
Use the OpenAI-compatible endpoint.
https://api.shannon-ai.com/v1/chat/completionsAdd your API key
Use Bearer auth in the Authorization header.
Send your first message
Pick a language and swap in your key.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://api.shannon-ai.com/v1")response = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello, Shannon!"}],max_tokens=1024)print(response.choices[0].message.content)
Response format
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1234567890,
"model": "shannon-balanced-grpo",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm Shannon, your AI assistant. How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 18,
"total_tokens": 43
}
}API Playground
NewTest the Shannon API directly in your browser. Build your request, run it, and see the response in real-time.
One polished workbench for every public endpoint.
Switch between Chat Completions, Responses, and Messages without changing pages. The request body, auth header, stream parser, and SDK snippets all follow the selected protocol.
Chat Completions
/v1/chat/completions
Pick an endpoint, shape the payload, and run the request to inspect the live output.
Keep the request, headers, and client syntax aligned with the selected endpoint.
{"model": "shannon-balanced-grpo","messages": [{"role": "system","content": "You are Shannon. Answer crisply, commercially, and with strong structure."},{"role": "user","content": "Outline a clean launch plan for a new AI API aimed at startup founders."}],"max_tokens": 1024,"temperature": 0.7,"stream": true}
Authentication
All API requests require authentication using your Shannon API key.
OpenAI Format (Recommended)
Authorization: Bearer YOUR_API_KEY
Anthropic Format
X-API-Key: YOUR_API_KEYanthropic-version: 2023-06-01
Models
Shannon offers multiple models optimized for different use cases.
shannon-balanced-grpoBalancedFast, efficient responses for everyday tasks
shannon-deep-dapoDeepAdvanced reasoning for complex problems
shannon-coder-1CoderOptimized for Claude Code CLI with call-based quota
Function Calling
Define tools that Shannon can call to perform actions or retrieve information.
from openai import OpenAIimport jsonclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://api.shannon-ai.com/v1")# Define available tools/functionstools = [{"type": "function","function": {"name": "get_weather","description": "Get current weather for a location","parameters": {"type": "object","properties": {"location": {"type": "string","description": "City name, e.g., 'Tokyo'"},"unit": {"type": "string","enum": ["celsius", "fahrenheit"]}},"required": ["location"]}}}]response = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],tools=tools,tool_choice="auto")# Check if model wants to call a functionif response.choices[0].message.tool_calls:tool_call = response.choices[0].message.tool_calls[0]print(f"Function: {tool_call.function.name}")print(f"Arguments: {tool_call.function.arguments}")
Tool Choice Options
Function Call Response
{
"id": "chatcmpl-xyz",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_abc123",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"location\": \"Tokyo\", \"unit\": \"celsius\"}"
}
}
]
},
"finish_reason": "tool_calls"
}
]
}Structured Outputs
Force Shannon to respond with valid JSON that matches your schema.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://api.shannon-ai.com/v1")# Force JSON output with schemaresponse = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "Extract: John Doe, 30 years old, engineer"}],response_format={"type": "json_schema","json_schema": {"name": "person_info","schema": {"type": "object","properties": {"name": {"type": "string"},"age": {"type": "integer"},"occupation": {"type": "string"}},"required": ["name", "age", "occupation"]}}})import jsondata = json.loads(response.choices[0].message.content)print(data) # {"name": "John Doe", "age": 30, "occupation": "engineer"}
Response Format Options
Streaming
Enable real-time token streaming with Server-Sent Events for responsive UIs.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://api.shannon-ai.com/v1")# Enable streaming for real-time responsesstream = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "Write a short poem about AI"}],stream=True)for chunk in stream:if chunk.choices[0].delta.content:print(chunk.choices[0].delta.content, end="", flush=True)
Built-in Web Search
Shannon includes a built-in web_search function that's automatically available.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://api.shannon-ai.com/v1")# Web search is automatically available!# Shannon will use it when needed for current informationresponse = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "What are the latest AI news today?"}],# Optionally, explicitly define web_search tooltools=[{"type": "function","function": {"name": "web_search","description": "Search the web for current information","parameters": {"type": "object","properties": {"query": {"type": "string", "description": "Search query"}},"required": ["query"]}}}])print(response.choices[0].message.content)# Response includes sources and citations
Anthropic Format
Shannon also supports Anthropic's Messages API format.
https://api.shannon-ai.com/v1/messagesimport anthropicclient = anthropic.Anthropic(api_key="YOUR_API_KEY",base_url="https://api.shannon-ai.com/messages")response = client.messages.create(model="shannon-balanced-grpo",max_tokens=1024,messages=[{"role": "user", "content": "Hello, Shannon!"}],# Tool use (Anthropic format)tools=[{"name": "web_search","description": "Search the web","input_schema": {"type": "object","properties": {"query": {"type": "string"}},"required": ["query"]}}])print(response.content[0].text)
SDKs
CompatibleUse any OpenAI or Anthropic SDK - just change the base URL.
OpenAI-Compatible SDKs
Anthropic-Compatible SDKs
Error Handling
Shannon uses standard HTTP status codes and returns detailed error messages.
Error Response Format
{
"error": {
"message": "Invalid API key provided",
"type": "authentication_error",
"code": "invalid_api_key"
}
}Changelog
Recent updates and improvements to the Shannon API.
- NewAdded shannon-coder-1 model for Claude Code CLI integration
- NewCall-based quota system for Coder model
- ImprovedImproved function calling reliability
- NewAdded Anthropic Messages API compatibility
- NewMulti-turn tool execution (up to 10 iterations)
- NewJSON Schema response format support
- ImprovedEnhanced web search with better citations
- NewAdded shannon-deep-dapo model for complex reasoning
- NewBuilt-in web_search function
- ImprovedReduced latency for streaming responses
- NewInitial API release
- NewOpenAI-compatible chat completions endpoint
- NewFunction calling support
- NewStreaming via Server-Sent Events
Ready to Build?
Get your API key and start building with Shannon AI today.