Skip to main content

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 $ref references locally
Quick Start: See Adding Custom Tools Guide for step-by-step instructions.

Configuration Reference

Basic Configuration

Field Descriptions

Authentication Types

No Authentication

Bearer Token

Used by: GitHub, GitLab, most modern APIs
Environment Variable:
Headers sent:

API Key in Header

Used by: OpenAI, Anthropic, many SaaS APIs
Environment Variable:
Headers sent:

API Key in Query Parameter

Used by: OpenWeather, some legacy APIs
Request URL:

Basic Authentication

Used by: Legacy APIs, internal services
Environment Variables:
Headers sent:

Custom 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):
By tags:

Base URL Override

Override the base URL from the spec:
Use cases:
  • Testing against staging/dev environments
  • Internal proxies or gateways
  • Local development

Rate Limiting

Protect external APIs from overload:
Per-tool limits: Each operation generated from the spec inherits this limit. Behavior:
  • 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):
States:
  1. Closed (normal): All requests pass through
  2. Open (failing): All requests immediately rejected
  3. Half-open (testing): One trial request allowed
Behavior:
  • 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:
Behavior:
  • Responses larger than limit are truncated
  • Error returned with truncated marker

Troubleshooting

Tool Not Registered

Symptom: Tool doesn’t appear in /tools/list Debug:
Common causes:
  • enabled: false in config
  • Invalid OpenAPI spec
  • Domain not in OPENAPI_ALLOWED_DOMAINS
  • Spec fetch timeout
  • Circular $ref references

Domain Validation Error

Symptom: URL host 'example.com' not in allowed domains Fix:
In docker-compose.yml:

Spec Fetch Timeout

Symptom: Failed to fetch OpenAPI spec: timeout Fix:

Circuit Breaker Triggered

Symptom: Circuit breaker open for https://api.example.com Debug:
Fix:
  • 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:
Common causes:
  • Environment variable not set
  • Token expired
  • Wrong auth type (should be bearer not api_key)
  • Missing Bearer prefix for API key auth

Examples

Example 1: GitHub API

Usage:

Example 2: OpenWeather API

Usage:

Example 3: Internal API with Vendor Adapter

Vendor Adapter (python/llm-service/llm_service/tools/vendor_adapters/mycompany.py):

Security Best Practices

  • Shannon automatically upgrades HTTP to HTTPS for external APIs
  • localhost/127.0.0.1 allowed on HTTP for development

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

Quick Reference

Need Help?
  • Report issues: GitHub Issues
  • Examples: tests/e2e/06_openapi_petstore_test.sh