Expand description
API logging utilities Handles API query, error, and success logging with analytics
Structs§
- ApiLog
Entry - API log entry
- ApiLogger
- Global API logger
- ApiUsage
- Usage statistics from API response
- Cache
Creation - Server
Tool Use
Enums§
- ApiLog
Level - Log level for API logging
- Global
Cache Strategy - Global cache strategy type
- Known
Gateway - Known gateway types
Constants§
- EMPTY_
USAGE - Empty usage struct - zero-initialized usage object Extracted from emptyUsage.ts so that bridge/replBridge can import it without transitively pulling in api/errors.ts → utils/messages.ts → BashTool.tsx
Functions§
- detect_
gateway - Detect gateway from response headers or base URL
- get_
anthropic_ env_ metadata - Get Anthropic environment metadata from environment variables
- get_
api_ provider_ for_ statsig - Get API provider for statsig
- get_
build_ age_ minutes - Get build age in minutes if BUILD_TIME is set
- is_
non_ interactive_ session - Check if running in non-interactive session
- log_
api_ error - Log API error event
- log_
api_ query - Log API query event
- log_
api_ success - Log API success event