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 name | AI Open SDK Anthropic |
| Factory | "AIOS Anthropic" |
| Provider id | anthropic |
| Text | Yes |
| Image | No |
| Default base URL | https://api.anthropic.com/v1 |
Default anthropic-version | 2023-06-01 |
Dependencies
Your extension depends on:
- AI Open SDK (core)
- AI Open SDK Anthropic
Before the first call, an administrator must agree to the AI Open SDK Anthropic notice on the Privacy Notices Status page, and users need the AIOS Anthropic User permission set. See Getting Started.
Generate text
Anthropic: Codeunit "AIOS Anthropic";
Client: Codeunit "AIOS Client";
Result: Codeunit "AIOS Generate Result";
ApiKey: SecretText;
begin
Result := Client.GenerateText(
Anthropic.Model('claude-fable-5', ApiKey),
'Summarize this invoice');
Message(Result.Output());
end;
With a system message:
Result := Client.GenerateText(
Anthropic.Model('claude-fable-5', ApiKey),
'You are a Business Central assistant.',
Prompt);
Factory API
| Procedure | Behavior |
|---|---|
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) |
SetBaseUrl(Url) | Overrides the API base (default https://api.anthropic.com/v1), for example for a proxy |
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.