Dashboard › opencode › Distillation
595315a8-3f4c-44e3-9d1f-482be2640de1["lore_tm_v1_XQGXeAr9gF9PXKHvn018UCrfBwqmNAUZL6NWEUveg50"]
Date: September 9, 2026
/home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/anthropic.ts lines 32–37 define auth(options: ProviderAuthOption<"optional">): returns options.auth when present and truthy; otherwise uses Auth.optional("apiKey" in options ? options.apiKey : undefined, "apiKey").orElse(Auth.config("ANTHROPIC_API_KEY")).pipe(Auth.header("x-api-key"))./home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/anthropic.ts lines 39–51 define configure(input: Config = {}), remove apiKey and auth from spread-through options, call AnthropicCompatible.configure() with auth: auth(input) and provider: id, and return { id, model: (modelID: string | ModelID) => compatible.model(modelID), configure }./home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/anthropic.ts line 54 initializes the default export-like provider binding as export const provider = configure()./home/byk/Code/opencode-v2-pilot/packages/ai/src/providers/anthropic.ts lines 55–67 define model as ProviderPackage.Definition<Settings, AnthropicMessages.ProviderOptionsInput>["model"]; it throws Error("Anthropic apiKey cannot be combined with authToken") when both settings.apiKey and settings.authToken are defined.model, authentication selects { apiKey: settings.apiKey } when settings.authToken === undefined, otherwise { auth: Auth.bearer(settings.authToken) }; settings.headers is shallow-copied, settings.body becomes http: { body: { ...settings.body } }, settings.providerOptions is forwarded, and the configured provider calls .model(modelID).