AI model connections
An AI model connection names a model provider: where it answers, how the server signs in, and the model a test checks. It is a named connection like a database or a broker, kept in the same registry and referred to by name.
An administrator saves, tests and maintains AI model connections. An agent names one of them, and every run of that agent calls the provider through it. The AI assistant is a separate feature with its own configuration.
Six kinds of provider
provider | The service | Endpoint | Sign-in |
|---|---|---|---|
openai | The OpenAI API | Optional; https://api.openai.com/v1 by default | API key |
azureopenai | An Azure OpenAI resource, through its v1 path | Required | API key |
anthropic | The Anthropic API | Optional; https://api.anthropic.com by default | API key |
foundry | An Azure AI Foundry resource, through its OpenAI-compatible endpoint | Required | API key |
ollama | An Ollama server, for local models | Required | None |
openaicompatible | Any server that answers the OpenAI API | Required | API key or none |
The spellings azure-openai and openai-compatible are accepted too.
What a connection holds
{
"name": "ai-anthropic",
"provider": "anthropic",
"secretRef": "anthropicApiKey",
"settings": {
"defaultModel": "claude-sonnet-4-5",
"maxOutputTokensCap": 8192
}
}secretRef names the key in the secret store. The key itself is never part of a request body, never stored with the connection and never returned; the server sends it only to the provider. The host and the port are derived from the endpoint, so you do not send them.
settings takes these members and no others:
| Member | Meaning |
|---|---|
endpoint | Where the provider answers. An absolute https URL |
defaultModel | The model the test checks. For Azure OpenAI, the deployment name |
auth | apiKey or none, as the kind allows |
maxOutputTokensCap | A ceiling on output tokens for this connection |
maxConcurrency | How many agent runs may use this connection at the same time |
capabilities | What an administrator declares about a server Duna cannot know: openaicompatible and foundry only |
An unknown member is refused, free headers included.
The test
POST /connections/test sends one metadata request to the provider and never a generation request: no model runs and no token is generated. The answer says whether the provider was reachable, whether the sign-in worked, whether the model was found, how long it took, and what the model can do: native JSON schema output, temperature, reasoning settings, the output-token ceiling.
The test needs the connections.test permission, which the shipped policy gives to administrators. Testing anything other than a saved connection exactly as stored also needs connections.write, decided before any secret is read.
Off by default
ProcessFlow:Agents:Enabled is false unless an operator sets it.
- Off. Connections are saved, read, changed and deleted as data. A test answers
503agents.disabledand reads no secret, and an agent action fails withagent.disabled. No request leaves for a provider. - On. Connection tests and agent runs may call the provider. A run does so only through a connection that its company's policy allows.
A provider is not part of Duna's readiness check, so an outage at a provider does not take Duna down. It fails only the runs that need that provider, with a code a retry policy can act on.
Where an endpoint may point
The rules run when a connection is saved and again when the server connects.
- The endpoint must use
https, with no user name, query or fragment. - An address inside your network is refused: loopback, private and link-local ranges, and names such as
localhostor*.internal. - At connect time every address the name resolves to must be public, so a name that later points inward is refused too.
- Redirects are not followed and no proxy is used.
- Cloud metadata addresses are always refused.
An administrator can list hosts that are allowed inside the network, for example a local Ollama, in ProcessFlow:Agents:AllowedPrivateEndpoints. For a listed host plain http is accepted. The metadata addresses stay refused for a listed host as well.
See Agents and the agent action for what uses these connections, Agentic orchestration for the whole capability, and Operations & security for running Duna.