-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathenv.example
More file actions
146 lines (126 loc) · 4.58 KB
/
env.example
File metadata and controls
146 lines (126 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Application Settings
APP_NAME=Anthropic-Bedrock API Proxy
APP_VERSION=1.0.0
ENVIRONMENT=development
DEBUG=True
LOG_LEVEL=INFO
# Server Settings
HOST=0.0.0.0
PORT=8000
WORKERS=1
RELOAD=False
# API Settings
API_PREFIX=/v1
DOCS_URL=/docs
OPENAPI_URL=/openapi.json
CORS_ORIGINS=*
# AWS Settings
AWS_REGION=us-east-1
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# AWS_SESSION_TOKEN=
# BEDROCK_ENDPOINT_URL=
# DYNAMODB_ENDPOINT_URL=
# DynamoDB Tables
DYNAMODB_API_KEYS_TABLE=anthropic-proxy-api-keys
DYNAMODB_USAGE_TABLE=anthropic-proxy-usage
DYNAMODB_MODEL_MAPPING_TABLE=anthropic-proxy-model-mapping
DYNAMODB_MODEL_PRICING_TABLE=anthropic-proxy-model-pricing
DYNAMODB_USAGE_STATS_TABLE=anthropic-proxy-usage-stats
# Usage records TTL in days (0 to disable TTL)
USAGE_TTL_DAYS=7
# Authentication
API_KEY_HEADER=x-api-key
REQUIRE_API_KEY=True
MASTER_API_KEY=sk-your-master-key
# Rate Limiting
RATE_LIMIT_ENABLED=True
RATE_LIMIT_REQUESTS=1000
RATE_LIMIT_WINDOW=60
# Bedrock Prompt Caching
PROMPT_CACHING_ENABLED=True
# Default Cache TTL: '5m' or '1h' (optional, unset = Anthropic default 5m)
# DEFAULT_CACHE_TTL=1h
# Timeouts
BEDROCK_TIMEOUT=1800
DYNAMODB_TIMEOUT=10
STREAMING_TIMEOUT=300
# Bedrock Concurrency
BEDROCK_THREAD_POOL_SIZE=15
BEDROCK_SEMAPHORE_SIZE=15
# Feature Flags
ENABLE_TOOL_USE=True
ENABLE_EXTENDED_THINKING=True
ENABLE_DOCUMENT_SUPPORT=True
ENABLE_PROGRAMMATIC_TOOL_CALLING=False
ENABLE_WEB_SEARCH=False
ENABLE_WEB_FETCH=True
# Bedrock Service Tier: 'default', 'flex', 'priority', 'reserved'
DEFAULT_SERVICE_TIER=default
# ===========================================
# Programmatic Tool Calling (PTC) - requires Docker
# ===========================================
# PTC_SANDBOX_IMAGE=python:3.11-slim
# PTC_SESSION_TIMEOUT=270
# PTC_EXECUTION_TIMEOUT=60
# PTC_MEMORY_LIMIT=256m
# PTC_NETWORK_DISABLED=true
# ===========================================
# Web Search Configuration
# ===========================================
# WEB_SEARCH_PROVIDER=tavily # 'tavily' or 'brave'
# WEB_SEARCH_API_KEY=tvly-your-key # Search provider API key
# WEB_SEARCH_MAX_RESULTS=5
# WEB_SEARCH_DEFAULT_MAX_USES=10
# ===========================================
# Web Fetch Configuration (enabled by default, no API key needed)
# ===========================================
# WEB_FETCH_DEFAULT_MAX_USES=20
# WEB_FETCH_DEFAULT_MAX_CONTENT_TOKENS=100000
# ===========================================
# Image URL Sources (for ImageContent with source.type="url")
# Proxy fetches the URL and forwards bytes to Bedrock.
# ===========================================
# IMAGE_URL_FETCH_TIMEOUT_S=30.0
# IMAGE_URL_FETCH_MAX_BYTES=20971520 # 20 MB; Bedrock enforces stricter per-model limits
# ===========================================
# OpenAI-Compatible API (Bedrock Mantle) - for non-Claude models
# When enabled, non-Claude models use OpenAI Chat Completions API
# via bedrock-mantle endpoint instead of Bedrock Converse API.
# Claude models still use InvokeModel API.
# OPENAI_API_KEY and OPENAI_BASE_URL are deprecated fallbacks.
# ===========================================
# ENABLE_OPENAI_COMPAT=False
# BEDROCK_API_KEY=your-bedrock-api-key
# MANTLE_ENDPOINT_URL=https://bedrock-mantle.us-east-1.api.aws/v1
# OPENAI_COMPAT_THINKING_HIGH_THRESHOLD=10000
# OPENAI_COMPAT_THINKING_MEDIUM_THRESHOLD=4000
# ===========================================
# OpenAI Passthrough — mount /openai/v1/* endpoints accepting native OpenAI
# Chat Completions and Responses API requests, forwarded to bedrock-mantle.
# Independent of ENABLE_OPENAI_COMPAT (the two flags can be enabled together).
# Reuses BEDROCK_API_KEY and MANTLE_ENDPOINT_URL.
# ===========================================
# ENABLE_OPENAI_PASSTHROUGH=False
# Proxy-managed Responses API web_search state for previous_response_id.
# CDK creates and injects DYNAMODB_RESPONSE_CONTEXT_TABLE automatically.
# Context is gzip-compressed, sharded into DynamoDB items, API-key scoped,
# and expired by TTL.
# DYNAMODB_RESPONSE_CONTEXT_TABLE=anthropic-proxy-response-context
# RESPONSE_CONTEXT_TTL_SECONDS=3600
# RESPONSE_CONTEXT_CHUNK_SIZE_BYTES=262144
# RESPONSE_CONTEXT_MAX_BYTES=1048576
# RESPONSE_CONTEXT_MAX_CHUNKS=8
# ===========================================
# OpenTelemetry Tracing
# ===========================================
# ENABLE_TRACING=false
# OTEL_EXPORTER_OTLP_ENDPOINT=https://us.cloud.langfuse.com/api/public/otel
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic <base64(publicKey:secretKey)>
# OTEL_SERVICE_NAME=anthropic-bedrock-proxy
# OTEL_TRACE_CONTENT=false
# OTEL_TRACE_SAMPLING_RATIO=1.0
# Monitoring
ENABLE_METRICS=True
# SENTRY_DSN=