Overview
Shannon can automatically generate tools from OpenAPI 3.x specifications, allowing you to integrate any REST API without writing code. The OpenAPI loader:- ✅ Parses OpenAPI 3.0/3.1 specs
- ✅ Generates one tool per operation
- ✅ Handles authentication (Bearer, API Key, Basic)
- ✅ Supports path/query/header parameters
- ✅ Includes circuit breaker and rate limiting
- ✅ Validates requests against schema
- ✅ Resolves
$refreferences locally
Configuration Reference
Basic Configuration
Field Descriptions
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
enabled | boolean | Yes | - | Enable this tool collection |
spec_path | string | One of spec_* | - | Local file path to OpenAPI spec |
spec_url | string | One of spec_* | - | URL to fetch spec from (supports relative server URLs) |
spec_inline | string | One of spec_* | - | Inline YAML/JSON spec content |
auth_type | enum | Yes | none | Authentication method |
auth_config | object | If auth ≠ none | {} | Auth configuration (varies by type) |
category | string | No | "api" | Tool category for organization |
base_cost_per_use | float | No | 0.001 | Estimated cost per invocation (USD) |
rate_limit | integer | No | 30 | Max requests per minute per tool |
timeout_seconds | float | No | 30.0 | HTTP request timeout |
max_response_bytes | integer | No | 10485760 | Max response size (10MB) |
operations | array[string] | No | All | Filter to specific operationIds |
tags | array[string] | No | All | Filter operations by tags |
base_url | string | No | From spec | Override API base URL |
Authentication Types
No Authentication
Bearer Token
Used by: GitHub, GitLab, most modern APIsAPI Key in Header
Used by: OpenAI, Anthropic, many SaaS APIsAPI Key in Query Parameter
Used by: OpenWeather, some legacy APIsBasic Authentication
Used by: Legacy APIs, internal servicesCustom Headers
For vendor-specific authentication:Dynamic Header Templates:
"${ENV_VAR}"- Resolved from environment"{{body.field}}"- Resolved from request body at runtime- Static strings - Used as-is
Advanced Features
Operation Filtering
By operationId (recommended):Base URL Override
Override the base URL from the spec:- Testing against staging/dev environments
- Internal proxies or gateways
- Local development
Rate Limiting
Protect external APIs from overload:- Enforced via token bucket algorithm
- Shared across all tool instances (single Shannon instance)
- Returns error if limit exceeded
Circuit Breaker
Automatic failure protection: Configuration (via environment):- Closed (normal): All requests pass through
- Open (failing): All requests immediately rejected
- Half-open (testing): One trial request allowed
- After 5 consecutive failures → opens circuit
- Circuit stays open for 60 seconds
- Then allows one trial request (half-open)
- Success → closes circuit
- Failure → reopens for another 60 seconds
Response Size Limits
Prevent memory exhaustion:- Responses larger than limit are truncated
- Error returned with truncated marker
Troubleshooting
Tool Not Registered
Symptom: Tool doesn’t appear in/tools/list
Debug:
enabled: falsein config- Invalid OpenAPI spec
- Domain not in
OPENAPI_ALLOWED_DOMAINS - Spec fetch timeout
- Circular
$refreferences
Domain Validation Error
Symptom:URL host 'example.com' not in allowed domains
Fix:
Spec Fetch Timeout
Symptom:Failed to fetch OpenAPI spec: timeout
Fix:
Circuit Breaker Triggered
Symptom:Circuit breaker open for https://api.example.com
Debug:
- Wait 60 seconds for automatic recovery
- Fix underlying API issues
- Increase timeout if API is slow:
Rate Limit Exceeded
Symptom:Rate limit exceeded for tool my_tool
Fix:
Authentication Failures
Symptom:401 Unauthorized or 403 Forbidden
Debug:
- Environment variable not set
- Token expired
- Wrong auth type (should be
bearernotapi_key) - Missing
Bearerprefix for API key auth
Examples
Example 1: GitHub API
Example 2: OpenWeather API
Example 3: Internal API with Vendor Adapter
python/llm-service/llm_service/tools/vendor_adapters/mycompany.py):
Security Best Practices
Never hardcode secrets
Never hardcode secrets
Use domain allowlisting
Use domain allowlisting
Set appropriate rate limits
Set appropriate rate limits
Use HTTPS
Use HTTPS
- Shannon automatically upgrades HTTP to HTTPS for external APIs
- localhost/127.0.0.1 allowed on HTTP for development
Limit response sizes
Limit response sizes
See Also
Adding Custom Tools
Complete tool integration guide
Vendor Adapters
Domain-specific integrations
Extending Shannon
Other extension methods
OpenAPI Tests
Test examples and validation