Setup
The agents are configured on the AI Providers page, which belongs to the AL AI Services app and is shared by every Hougaard app that hosts an agent. You enter one row per AI provider you want to use and mark the row the ToolBox agents should use with the ToolBox Agent toggle. This page walks through the prerequisites, the fields, each provider's endpoint and key, and how to verify the setup.
Prerequisites
| Requirement | Why |
|---|---|
| AL AI Services app installed | It is a dependency of Erik's ToolBox and is installed with it. Check Extension Management if the AI Providers action is missing. |
| Allow HttpClient Requests enabled for AL AI Services | The HTTP calls to the AI provider are made by this extension. Open Extension Management, select AL AI Services, and turn the setting on. If it is off, the chat shows "Allow HttpClient Requests" is turned off for this extension in Extension Management, please correct. |
| An account and API key with a provider | Every cloud provider needs a key. LM Studio does not. |
| ToolBox permission set | The Erik's ToolBox permission set includes the AI Providers and AI Conversations objects. The separate AL AI Services permission set grants the same objects on their own. |
| Network access | The Business Central service tier must reach the provider's endpoint. See System Requirements. |
Opening the AI Providers Page
The page is not on the Business Central search menu. Open it from one of these actions:
- ToolBox Setup page: the AI Providers action (promoted in the action bar).
- Erik's ToolBox - Interactive Code page: the AI Providers action.
- SQL Workbench page: the AI Providers action.
Every ToolBox user with the ToolBox permission set can open the page and read the keys it holds. Restrict the permission set accordingly if that is a concern; see Security below.
The AI Providers Page
The page is a list with one row per provider. The Provider field is the key, so each provider appears at most once.
| Field | Description |
|---|---|
| Provider | Which service the row describes. One of the twelve providers listed below. |
| Endpoint | The full URL the request is posted to. For most providers this is their chat completions URL; see the reference table. |
| Access Key | The API key. Shown masked. Use the drill-down on the field to open the provider's key management console in a new tab. Leave empty for LM Studio. |
| Model | The model name (for Azure: the deployment name). Leave empty to use the ToolBox default for that provider. |
| ToolBox Agent | Turn this on for the row the ToolBox coding agent and SQL Agent should use. Added by the ToolBox app. |
Other Hougaard apps that host agents add their own toggle columns to the same list (for example a Spreadsheet Agent toggle). Each app's agent uses the row with its own toggle on, so different agents can run on different providers and models while sharing one setup page.
Step by Step
- Open AI Providers from the ToolBox Setup page.
- Add a row and select the Provider.
- Enter the Endpoint from the reference table below.
- Enter the Access Key. Use the drill-down on the field to reach the provider's console if you need to create one.
- Enter a Model, or leave it empty to use the default.
- Turn on ToolBox Agent for this row. Turn it off on any other row.
- Close the page.
- Reopen the Interactive Code page or the SQL Workbench. The agent panel is created when the page opens, so a page that was already open does not pick up the new setup.
The panel appears as a FactBox captioned ToolBox Agent (Interactive Code) or SQL Agent (SQL Workbench) with an intro screen. If no row has the toggle on, the panel is hidden.
Provider Reference
The ToolBox adds the correct authentication header for each provider automatically. You only supply the endpoint, the key, and optionally the model. The endpoints below are the providers' published chat endpoints at the time of writing; confirm them against the provider's current documentation if a call fails.
| Provider | Endpoint | Default model | Attachments | Key console |
|---|---|---|---|---|
| Azure Open AI | https://<resource>.openai.azure.com/openai/deployments/<deployment>/chat/completions?api-version=<version> |
None (the deployment in the URL is used) | Images, PDF | ai.azure.com |
| ChatGPT Open AI | https://api.openai.com/v1/chat/completions |
gpt-5-mini |
Images, PDF | platform.openai.com |
| Anthropic (Claude) | https://api.anthropic.com/v1/messages |
claude-haiku-4-5 |
Images, PDF | platform.claude.com |
| LM Studio | http://<host>:1234/v1/chat/completions |
None (the loaded model) | Images | Not needed |
| Google Gemini | https://generativelanguage.googleapis.com/v1beta/models/ |
gemini-2.5-flash |
Images, PDF | aistudio.google.com |
| xAI Grok | https://api.x.ai/v1/chat/completions |
grok-4 |
Images (JPEG, PNG) | console.x.ai |
| Mistral | https://api.mistral.ai/v1/chat/completions |
mistral-large-latest |
Images | console.mistral.ai |
| DeepSeek | https://api.deepseek.com/chat/completions |
deepseek-chat |
Images | platform.deepseek.com |
| Moonshot Kimi | https://api.moonshot.ai/v1/chat/completions |
moonshot-v1-8k |
Images | platform.moonshot.ai |
| Alibaba Qwen | https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions |
qwen-plus |
Images | bailian.console.alibabacloud.com |
| Zhipu GLM | https://api.z.ai/api/paas/v4/chat/completions |
glm-4-plus |
Images | z.ai |
| MiniMax | https://api.minimax.io/v1/text/chatcompletion_v2 |
MiniMax-M2 |
Images | platform.minimax.io |
"Images" means JPEG, PNG, GIF, and WebP files attached in the chat. Files of other types are ignored silently.
Azure Open AI
- Provision an Azure OpenAI resource and create a deployment of a model that supports tool calling.
- The endpoint must be the full chat completions URL for that deployment, including the
api-versionquery parameter. Use a current API version from the Azure documentation. - The Model field can stay empty because the deployment is named in the URL. If you fill it in, use the deployment name, not the underlying model name.
- The key is sent in the
api-keyheader. Missing key error:Azure OpenAI is missing an API key.
ChatGPT Open AI
- Create a key on the OpenAI platform and make sure the account has credit.
- The key is sent as a Bearer token. Missing key error:
ChatGPT OpenAI is missing an API key. - With an empty Model field the ToolBox uses
gpt-5-mini. Enter a more capable model for harder coding tasks.
Anthropic (Claude)
- Create a key in the Claude platform console.
- The key is sent in the
x-api-keyheader together with the requiredanthropic-versionheader. Missing key error:Anthropic provider is missing an API key. - With an empty Model field the ToolBox uses
claude-haiku-4-5. Replies are allowed up to 40,000 output tokens. - The ToolBox marks the instructions, the tool definitions, and the conversation prefix for prompt caching, so repeated round trips in one conversation are billed at the cached rate for the unchanged part.
LM Studio
- Start LM Studio's local server with a model loaded. The model must support tool calling, otherwise the agent cannot act.
- The endpoint is the server's OpenAI-compatible chat completions URL.
localhostonly works when the Business Central service tier runs on the same machine; a SaaS environment cannot reach your workstation, so LM Studio is an on-premises or self-hosted option. Use a hostname or IP address the service tier can reach. - The key can stay empty. If you set one, it is sent as a Bearer token.
- Server certificate validation is disabled for the call, so a self-signed HTTPS certificate on the LM Studio host is accepted.
- Leave Model empty when only one model is loaded, otherwise enter the model identifier LM Studio shows.
Google Gemini
- Create a key in Google AI Studio. The key is sent in the
x-goog-api-keyheader. Missing key error:Google Gemini provider is missing an API key. - Enter the models base URL ending in
/models/. The ToolBox appends the model name and:generateContentitself, usinggemini-2.5-flashwhen Model is empty. You can also paste a complete URL that already ends in:generateContent; it is then used as is.
Grok, Mistral, DeepSeek, Kimi, Qwen, GLM, MiniMax
- These providers expose OpenAI-compatible chat completions APIs. The key is sent as a Bearer token; each provider has its own "is missing an API key" message.
- Use the endpoint from the reference table. Regional variants exist for some providers (for example Alibaba's China and international endpoints); pick the one your account belongs to.
- Leave Model empty for the default in the table, or enter any model the provider offers that supports tool calling.
Verifying the Setup
- Close and reopen Erik's ToolBox - Interactive Code.
- The ToolBox Agent FactBox should show the intro: the title, the subtitle "Erik's ToolBox - Interactive Code", and the hint "Ask me to write, fix or explain your program!".
- Type
What is in the editor right now?and press Enter. - You should see a tool indicator
get_program, then a check mark, then a short answer describing the program.
If the panel shows the message "We cannot activate the agent due to missing setup. Please configure an Agent in the app setup.", no row has the ToolBox Agent toggle on, or the page was opened before you saved the row.
If the answer is an error, it appears in the chat prefixed with ERROR Happened:. Common causes:
| Message | Cause | Fix |
|---|---|---|
"Allow HttpClient Requests" is turned off for this extension in Extension Management |
HttpClient is blocked for AL AI Services | Enable it for the AL AI Services extension |
<Provider> is missing an API key |
The Access Key field is empty | Enter the key |
AI Provider error: 401 (...) or 403 |
Wrong or expired key, or the key does not have access to the model | Regenerate the key; check the model name |
AI Provider error: 404 (...) |
Wrong endpoint or model/deployment name | Compare the endpoint with the reference table |
AI Provider error: 400 (...) |
The model does not support tool calling, or the request was rejected | Choose a model that supports tools |
Http Error: ... |
The service tier cannot reach the endpoint | Check DNS, firewall, and proxy settings |
Reply arrives after a long pause, or 429 text |
Rate limit; the ToolBox retries up to ten times, ten seconds apart | Wait, or raise the provider's rate limit |
Changing Providers or Models
- To switch providers, turn the ToolBox Agent toggle off on the current row and on on another, then reopen the page.
- To change the model, edit the Model field and reopen the page.
- Existing saved conversations remember the provider and model they were created with. Resuming one uses that provider's row (its current endpoint and key), so a conversation started on Anthropic continues on Anthropic even if the toggle has moved. See Conversations.
Migration From the ToolBox Setup Page
Versions before 5.0 configured the agent in a Coding Agent Setup group on the ToolBox Setup page. Those fields (Use Coding Agent, Agent AI Provider, Provider Endpoint, Provider Key, Provider Model) are obsolete and hidden. Their values are not copied to the AI Providers page. Re-enter the endpoint, key, and model there and turn on the ToolBox Agent toggle.
Security
- Where keys live. Access Keys are stored in the AI Provider table of the AL AI Services app. The page masks them, but any user who can read the table (the ToolBox permission set grants this) can read them through other means. Assign the ToolBox permission set only to people who may know the key, or give the provider a key with a spending limit.
- Prefer tenant-bound providers for sensitive data. Azure Open AI keeps traffic in your tenant; LM Studio keeps it on your network.
- Rotate keys on the provider's schedule and update the row.
- Set spending limits at the provider. An agent in a long debugging session makes many calls.
- Review the conversation store. Saved conversations contain tool results (program source, sample rows, console output) and attached files. Delete conversations you no longer need on the AI Conversations page.