ClientOptions interface when instantiating the client. All options are optional and can be set via constructor parameters or environment variables.
Basic Configuration
ClientOptions Interface
API key for Bearer token authentication.Defaults to
process.env.DEDALUS_API_KEYAPI key for X-API-Key header authentication.Defaults to
process.env.DEDALUS_X_API_KEYOrganization ID for request scoping.Defaults to
process.env.DEDALUS_ORG_IDProvider name for Bring Your Own Key (BYOK) mode.Defaults to
process.env.DEDALUS_PROVIDERProvider API key for BYOK mode.Defaults to
process.env.DEDALUS_PROVIDER_KEYModel identifier for BYOK provider.Defaults to
process.env.DEDALUS_PROVIDER_MODELSpecifies the environment to use for the API.Each environment maps to a different base URL:
productioncorresponds tohttps://api.dedaluslabs.aidevelopmentcorresponds tohttp://localhost:8080
'production'Override the default base URL for the API, e.g.,
"https://api.example.com/v2/"Defaults to process.env.DEDALUS_BASE_URLThe maximum amount of time (in milliseconds) that the client should wait for a response from the server before timing out a single request.Defaults to
Request timeouts are retried by default, so in a worst-case scenario you may wait much longer than this timeout before the promise succeeds or fails.
60000 (1 minute)The maximum number of times that the client will retry a request in case of a temporary failure, like a network error or a 5XX error from the server.Defaults to
2Specify a custom
fetch function implementation.If not provided, the SDK expects that fetch is defined globally.Additional
RequestInit options to be passed to fetch calls.Properties will be overridden by per-request fetchOptions.Default headers to include with every request to the API.These can be removed in individual requests by explicitly setting the header to
null in request options.Default query parameters to include with every request to the API.These can be removed in individual requests by explicitly setting the param to
undefined in request options.Set the log level for SDK logging.Defaults to
process.env.DEDALUS_LOG or 'warn' if not set.Set a custom logger implementation.Defaults to
globalThis.consoleEnvironment Variables
All configuration options can be set via environment variables:| Option | Environment Variable |
|---|---|
apiKey | DEDALUS_API_KEY |
xAPIKey | DEDALUS_X_API_KEY |
organization | DEDALUS_ORG_ID |
provider | DEDALUS_PROVIDER |
providerKey | DEDALUS_PROVIDER_KEY |
providerModel | DEDALUS_PROVIDER_MODEL |
baseURL | DEDALUS_BASE_URL |
logLevel | DEDALUS_LOG |
Creating Modified Clients
UsewithOptions() to create a new client instance with modified configuration: