Interface: AdapterProviderDefinition
Makaio Framework / ai-adapters-core / AdapterProviderDefinition
Interface: AdapterProviderDefinition
Section titled “Interface: AdapterProviderDefinition”Defined in: ../../../adapters/core/src/types/provider-definition.ts:34
Runtime adapter provider definition pairing a serializable provider definition with optional runtime-only schemas.
Extends AdapterProviderDefinitionContract from @makaio/contracts which
is the single source of truth for the definition, configSchema, and
credentialSchema fields. All fields are inherited from the contract — this
type exists to give the shape a domain-specific name used throughout
adapter implementation packages and to allow future additions specific to
ai-adapters-core.
Each adapter exports an array of these from its definition.ts (via providers).
The definition field contains serializable data (models, endpoints, etc.).
The schema fields are runtime-only — used for UI form generation, never serialized.
Example
Section titled “Example”const anthropicProvider: AdapterProviderDefinition = { definition: { id: 'anthropic', name: 'Anthropic', endpoints: { anthropic: 'https://api.anthropic.com' }, defaultModel: 'sonnet', availableModels: [...] }, credentialSchema: z.object({ apiKey: z.string().describe('Anthropic API Key') })};Extends
Section titled “Extends”Properties
Section titled “Properties”configSchema?
Section titled “configSchema?”
readonlyoptionalconfigSchema?:ZodObject<Readonly<{[k:string]:$ZodType<unknown,unknown,$ZodTypeInternals<unknown,unknown>>; }>,$strip>
Defined in: ../../../adapters/core/src/types/provider-definition.ts:42
Provider-specific config schema for UI form generation (runtime-only).
Defines provider-specific configuration fields like debugging flags, rate limiting options, or provider-specific features. Not serialized — used for dynamic form generation in the settings UI.
Overrides
Section titled “Overrides”AdapterProviderDefinitionContract.configSchema
credentialSchema?
Section titled “credentialSchema?”
readonlyoptionalcredentialSchema?:ZodObject<Readonly<{[k:string]:$ZodType<unknown,unknown,$ZodTypeInternals<unknown,unknown>>; }>,$strip>
Defined in: ../../../adapters/core/src/types/provider-definition.ts:51
Provider-specific credential schema for secure credential capture (runtime-only).
Defines credential fields (apiKey, apiSecret, etc.) for secure input. Credentials are stored separately via the credential service, never in plain config. Not serialized — used for dynamic form generation in the settings UI.
Overrides
Section titled “Overrides”AdapterProviderDefinitionContract.credentialSchema
definition
Section titled “definition”
readonlydefinition:object
Defined in: ../../../packages/contracts/src/extension/adapter-definition.ts:69
Provider identity, model catalog, and endpoint declarations.
Accepts ProviderDefinitionInput so adapter packages that declare
static providerDefinition constants can omit availableModels (which
the registry service populates at boot time). The runtime-resolved type
narrows after the adapter subsystem merges the registry data.
availableModels?
Section titled “availableModels?”
optionalavailableModels?:object[]
Runtime-populated model catalog for this provider.
At boot the registry service merges lab definitions with provider-specific
overrides and injects the result here. Static provider packages and fixtures
should omit this field from ProviderDefinitionInput; the registry
service owns the content. Defaults to [] on parsed definitions so runtime
callers never need to handle undefined.
credentialEnvVars?
Section titled “credentialEnvVars?”
optionalcredentialEnvVars?:Record<string,string>
Environment variable names for credential fields.
Maps credential field names (matching the adapter’s credentialSchema keys)
to environment variable names. Used as last-resort fallback when credentials
are not provided via saved config or runtime input.
Example
Section titled “Example”`{ apiKey: 'ANTHROPIC_API_KEY' }` or `{ token: 'COPILOT_TOKEN' }`defaultModel?
Section titled “defaultModel?”
optionaldefaultModel?:string
Default model identifier for general-purpose tasks (e.g., 'claude-sonnet-4-5').
Optional — providers with fully dynamic model discovery may omit this.
defaultModelFilterMode?
Section titled “defaultModelFilterMode?”
optionaldefaultModelFilterMode?:"allowlist"|"show-all"
Recommended default filter mode applied when a provider record is first created.
'show-all'— all models visible by default (curated providers like Anthropic).'allowlist'— all models hidden by default (firehose providers like OpenRouter).
Defaults to 'show-all' in the sync service when omitted.
description?
Section titled “description?”
optionaldescription?:string
Short human-readable description of the provider.
endpoints?
Section titled “endpoints?”
optionalendpoints?:object
Wire protocol endpoints for this provider.
Maps each supported protocol to a base URL. Omit for SDK-only providers (e.g., GitHub Copilot) that communicate through a proprietary transport.
endpoints.anthropic?
Section titled “endpoints.anthropic?”
optionalanthropic?:string
endpoints.openai?
Section titled “endpoints.openai?”
optionalopenai?:string
fastModel?
Section titled “fastModel?”
optionalfastModel?:string
Fast/cheap model for cost-sensitive operations (e.g., 'claude-haiku-4-5').
Used for subagent exploration and background processing.
Falls back to defaultModel when omitted.
id:
string
Stable provider identifier used for persistence and matching (e.g., 'anthropic', 'z-ai').
Acts as the primary key across all provider-related storage and bus messages. Must be unique across all registered provider packages.
name:
string
Display name shown in the UI (e.g., 'Anthropic', 'Z.AI').