Configuration
The bx-ai settings you will actually use, on one page.
Settings live in boxlang.json under modules.bxai.settings. Every setting has a default, so set only what you need. Your values are merged over the defaults.
{
"modules": {
"bxai": {
"settings": {
"provider": "openai",
"defaultParams": { "model": "gpt-4.1", "temperature": 0.7 }
}
}
}
}The basics
provider
"openai"
Provider used when a call does not name one
apiKey
""
Key for provider. Prefer the <PROVIDER>_API_KEY env var
defaultParams
{}
Request params for every call, such as model and temperature
timeout
90
Request timeout in seconds
returnFormat
"single"
What aiChat() returns: single, all, raw, json or xml
Providers
Give a provider its own params and options. They apply whenever that provider is used:
Profiles
A profile is a named combination of provider, model, params, options and key. Use it when you switch between setups, such as a fast model and a planner model:
See Profiles for agents, switching and listing.
Embeddings
aiEmbed() uses your chat provider unless you say otherwise:
Logging
logRequest / logResponse
false
Write requests or responses to ai.log
logRequestToConsole / logResponseToConsole
false
Print them to the console. Best way to debug a provider
Everything else
You can leave these alone until you need them.
memory
audio
image
security
webSearch
mcp
MCP stdio clients, MCP server rate limiting and trusted proxies
skillsDirectory, autoLoadSkills
gateways
API keys
Set
<PROVIDER>_API_KEYin the environment, for exampleOPENAI_API_KEY. This is the default way and needs no setting.For a profile, set
apiKeyEnvto the name of the variable. The profile never stores the key.Pass
apiKeyin the call options to override everything else.
Override per call
A call always wins over settings:
The order, lowest to highest: defaultParams, the provider's params, the profile, the params of the call.
Full provider walkthroughs are in Provider Setup.
Last updated