http
@providerprotocol/ai / http
HTTP utilities module for unified provider protocol.
This module provides comprehensive HTTP infrastructure including:
- API key management with multiple strategies (round-robin, weighted, dynamic)
- Retry strategies (exponential backoff, linear backoff, retry-after, no-retry)
- Fetch wrappers with timeout and error normalization
- Server-Sent Events (SSE) stream parsing
- Standardized error handling and normalization
Functions
Section titled “Functions”- cancelledError
- doFetch
- doStreamFetch
- maskApiKey
- networkError
- normalizeHttpError
- parseSimpleTextStream
- parseSSEStream
- resolveApiKey
- statusToErrorCode
- timeoutError
- warnInsecureUrl
References
Section titled “References”dynamicKey
Section titled “dynamicKey”Re-exports dynamicKey
exponentialBackoff
Section titled “exponentialBackoff”Re-exports exponentialBackoff
ExponentialBackoffOptions
Section titled “ExponentialBackoffOptions”Re-exports ExponentialBackoffOptions
linearBackoff
Section titled “linearBackoff”Re-exports linearBackoff
LinearBackoffOptions
Section titled “LinearBackoffOptions”Re-exports LinearBackoffOptions
noRetry
Section titled “noRetry”Re-exports noRetry
retryAfterStrategy
Section titled “retryAfterStrategy”Re-exports retryAfterStrategy
RetryAfterStrategyOptions
Section titled “RetryAfterStrategyOptions”Re-exports RetryAfterStrategyOptions
roundRobinKeys
Section titled “roundRobinKeys”Re-exports roundRobinKeys
weightedKeys
Section titled “weightedKeys”Re-exports weightedKeys