Connections
Connections store the credentials and settings needed to authenticate with an AI provider.
A connection represents a configured instance of an AI provider with credentials. It stores everything needed to authenticate and communicate with the provider's API.
What Connections Store
Id
Unique identifier (GUID)
Alias
Unique string for programmatic lookup
Name
Display name shown in the backoffice
ProviderId
Which provider this connection uses
Settings
Provider-specific settings (API key, endpoint, and so on)
IsActive
Whether the connection is enabled
Version
Current version number, increments with each save
Connection vs Provider
Think of it this way:
Provider = The service (for example, "OpenAI")
Connection = Your account with that service (for example, "My OpenAI API Key")
You can have multiple connections to the same provider:
OpenAI Provider
├── Connection: "Development" (dev API key)
├── Connection: "Production" (prod API key)
└── Connection: "Team A" (separate billing)Creating Connections
You can create and manage connections through the backoffice. See Managing Connections for step-by-step instructions.
Configuration References
Connection settings support configuration references. Values starting with $ are resolved from configuration (appsettings.json, environment variables, Azure Key Vault, and so on) at runtime.
References resolve from two dedicated configuration sections:
Umbraco:AI:Secrets- for sensitive values such as API keys. These can only be referenced from settings fields marked as sensitive (see Provider Settings).Umbraco:AI:Variables- for non-sensitive per-environment values such as endpoints, organization IDs, or feature flags.
Place the values you want to reference under these sections, then point the setting at them with the $ prefix:
Benefits of configuration references:
Sensitive values stay out of the database.
Different values per environment (dev/staging/prod)
Works with Azure Key Vault, environment variables, and more.
Accessing Connections in Code
Use IAIConnectionService to work with connections:
Related
Last updated
Was this helpful?