CloudflareConfig
Defined in: backend/src/providers/cloudflare.ts:96
Configuration options for backend adapters.
Extends
Section titled “Extends”Properties
Section titled “Properties”accountId?
Section titled “accountId?”
optionalaccountId:string
Defined in: backend/src/providers/cloudflare.ts:97
apiKey
Section titled “apiKey”
readonlyapiKey:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:103
API key for authentication. Should be injected from environment or secure config.
Inherited from
Section titled “Inherited from”baseURL?
Section titled “baseURL?”
readonlyoptionalbaseURL:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:108
Base URL for API endpoint. Useful for proxies or alternative endpoints.
Inherited from
Section titled “Inherited from”browserMode?
Section titled “browserMode?”
readonlyoptionalbrowserMode:boolean
Defined in: ai.matey.types/dist/types/adapters.d.ts:155
Enable browser-compatible mode.
⚠️ SECURITY WARNING: Enabling browser mode may expose API keys in client-side code. This option should ONLY be used for development and testing. Production applications should always use proxy servers to protect API keys.
Each provider implements browser compatibility differently:
- Anthropic: Adds
anthropic-dangerous-direct-browser-access: trueheader - Gemini: Already browser-compatible (API key in URL), this flag has no effect
- OpenAI: Already browser-compatible, this flag has no effect
- Other providers: May have provider-specific implementations
Default
Section titled “Default”falseExample
Section titled “Example”// Development only - DO NOT use in production!const backend = new AnthropicBackendAdapter({ apiKey: process.env.ANTHROPIC_API_KEY, browserMode: true // ⚠️ Exposes API key in browser});Inherited from
Section titled “Inherited from”BackendAdapterConfig.browserMode
cacheModels?
Section titled “cacheModels?”
readonlyoptionalcacheModels:boolean
Defined in: ai.matey.types/dist/types/adapters.d.ts:181
Enable model list caching.
Default
Section titled “Default”trueInherited from
Section titled “Inherited from”BackendAdapterConfig.cacheModels
custom?
Section titled “custom?”
readonlyoptionalcustom:Record<string,unknown>
Defined in: ai.matey.types/dist/types/adapters.d.ts:131
Provider-specific configuration options.
Inherited from
Section titled “Inherited from”debug?
Section titled “debug?”
readonlyoptionaldebug:boolean
Defined in: ai.matey.types/dist/types/adapters.d.ts:123
Enable debug logging.
Default
Section titled “Default”falseInherited from
Section titled “Inherited from”defaultModel?
Section titled “defaultModel?”
readonlyoptionaldefaultModel:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:162
Default model to use when no model is specified in the request. This provides a fallback model for requests that don’t specify one.
Example
Section titled “Example”'gpt-4o' for OpenAI, 'claude-3-5-sonnet-20241022' for AnthropicInherited from
Section titled “Inherited from”BackendAdapterConfig.defaultModel
headers?
Section titled “headers?”
readonlyoptionalheaders:Record<string,string>
Defined in: ai.matey.types/dist/types/adapters.d.ts:127
Custom HTTP headers to include in requests.
Inherited from
Section titled “Inherited from”maxRetries?
Section titled “maxRetries?”
readonlyoptionalmaxRetries:number
Defined in: ai.matey.types/dist/types/adapters.d.ts:118
Maximum number of retries for transient failures.
Default
Section titled “Default”0Inherited from
Section titled “Inherited from”BackendAdapterConfig.maxRetries
models?
Section titled “models?”
readonlyoptionalmodels: readonly (string|AIModel)[]
Defined in: ai.matey.types/dist/types/adapters.d.ts:171
Static model list (used when provider doesn’t have listing endpoint or to override remote list).
Can be either:
- Array of model IDs (strings) - will be normalized to AIModel objects
- Array of full AIModel objects with capabilities
Inherited from
Section titled “Inherited from”modelsCacheScope?
Section titled “modelsCacheScope?”
readonlyoptionalmodelsCacheScope:"global"|"instance"
Defined in: ai.matey.types/dist/types/adapters.d.ts:193
Cache scope strategy.
- ‘global’: Share cache across all adapter instances (default)
- ‘instance’: Each adapter instance has its own cache
Default
Section titled “Default”'global'Inherited from
Section titled “Inherited from”BackendAdapterConfig.modelsCacheScope
modelsCacheTTL?
Section titled “modelsCacheTTL?”
readonlyoptionalmodelsCacheTTL:number
Defined in: ai.matey.types/dist/types/adapters.d.ts:186
Cache TTL in milliseconds.
Default
Section titled “Default”3600000 (1 hour)Inherited from
Section titled “Inherited from”BackendAdapterConfig.modelsCacheTTL
modelsEndpoint?
Section titled “modelsEndpoint?”
readonlyoptionalmodelsEndpoint:string
Defined in: ai.matey.types/dist/types/adapters.d.ts:176
URL endpoint for fetching models (overrides default). Used for custom model endpoints or proxies.
Inherited from
Section titled “Inherited from”BackendAdapterConfig.modelsEndpoint
streaming?
Section titled “streaming?”
readonlyoptionalstreaming:StreamingConfig
Defined in: ai.matey.types/dist/types/adapters.d.ts:204
Streaming configuration for this backend.
Controls how streaming responses are delivered:
- mode: ‘delta’ (incremental only) or ‘accumulated’ (full text each chunk)
- includeBoth: Whether to provide both delta and accumulated in chunks
- bufferStrategy: How to buffer for accumulated mode
Default
Section titled “Default”{ mode: 'delta', includeBoth: false, bufferStrategy: 'memory' }Inherited from
Section titled “Inherited from”BackendAdapterConfig.streaming
timeout?
Section titled “timeout?”
readonlyoptionaltimeout:number
Defined in: ai.matey.types/dist/types/adapters.d.ts:113
Request timeout in milliseconds.
Default
Section titled “Default”30000