AI Open SDKfor Business Central

Anthropic

Claude models through the AI Open SDK Anthropic extension.

AI Open SDK Anthropic is a Business Central app that depends on AI Open SDK (core) and exposes the "AIOS Anthropic" factory.

App nameAI Open SDK Anthropic
Factory"AIOS Anthropic"
Provider idanthropic
TextYes
ImageNo
Default APIhttps://api.anthropic.com
Default anthropic-version2023-06-01

Dependencies

Your extension depends on:

  1. AI Open SDK (core)
  2. AI Open SDK Anthropic

Generate text

GenerateText.al
Anthropic: Codeunit "AIOS Anthropic";
Client: Codeunit "AIOS Client";
Result: Codeunit "AIOS Generate Result";
ApiKey: SecretText;
begin
    Result := Client.GenerateText(
        Anthropic.Model('claude-sonnet-4-5', ApiKey),
        'Summarize this invoice');
    Message(Result.Output());
end;

With a system message:

GenerateTextSystem.al
Result := Client.GenerateText(
    Anthropic.Model('claude-sonnet-4-5', ApiKey),
    'You are a Business Central assistant.',
    Prompt);

Factory API

ProcedureBehavior
Model(ModelId, KeyValue)Sets the API key and returns "AIOS Language Model"
Model(ModelId)Returns a model using a key previously set with SetApiKey
SetApiKey(KeyValue)Stores the Anthropic API key as SecretText
SetApiVersion(Version)Overrides the anthropic-version header (default 2023-06-01)
GetName()Returns anthropic
BindLanguageModel(ModelId, BoundModel)Soft-bind; returns false when model id or key is missing

Model errors when the model id is empty or the API key is missing.

Keys

Load the key into SecretText from Isolated Storage or a setup table. HTTP headers use the SecretText overloads so the debugger does not show the value.

On this page