Function: resolveProviderEndpoint()
Makaio Framework / ai-adapters-core/config / resolveProviderEndpoint
Function: resolveProviderEndpoint()
Section titled “Function: resolveProviderEndpoint()”resolveProviderEndpoint(
bus,providerConfigId,protocol):Promise<ProviderEndpoint>
Defined in: ../../../adapters/core/src/config/resolve-provider-endpoint.ts:45
Resolve { baseUrl, apiKey } for a given provider config and wire protocol
without requiring an agent context.
Intended for infrastructure-layer consumers (e.g., adapter-voice-bridge, cloud STT/TTS providers) that need to make HTTP calls to cloud providers but are not part of an agent turn.
Delegates the common lookup chain (config → definition → endpoint → credentials)
to resolveProviderResolution and applies strict validation on the result:
both baseUrl and apiKey must be present or an error is thrown.
Resolution order for the endpoint URL:
ProviderConfig.endpointOverrides[protocol](user-customised URL)ProviderDefinition.endpoints[protocol](default from provider package)
Credentials are resolved from the config’s stored credential refs via the bus.
Parameters
Section titled “Parameters”Makaio bus instance used to query storage and resolve credential refs
providerConfigId
Section titled “providerConfigId”string
UUID of the ProviderConfig entity to resolve
protocol
Section titled “protocol”"anthropic" | "openai"
Wire protocol to select the correct endpoint URL
Returns
Section titled “Returns”Promise<ProviderEndpoint>
Resolved { baseUrl, apiKey } for the provider
Throws
Section titled “Throws”Error when the ProviderConfig or its ProviderDefinition is not found, or
when baseUrl or apiKey cannot be resolved from any source