ProviderProfile
@Serializable
One configured agent provider. The API key is not part of the profile — it lives encrypted in SecretStore, keyed by id.
Constructors
Link copied to clipboard
constructor(id: String, name: String, kind: ProviderKind, baseUrl: String = "", model: String = "", useTools: Boolean = true, systemPrompt: String = DEFAULT_SYSTEM_PROMPT, builtIn: Boolean = false, oauth: OAuthProvider? = null)
Properties
Link copied to clipboard
Link copied to clipboard
Signed in with OAuth instead of an API key (see OAuthProvider).
Link copied to clipboard
Link copied to clipboard
Signed in with tokens (OpenRouter's sign-in yields a plain API key instead).
Functions
Link copied to clipboard
fun createBackend(apiKey: String, tools: List<AgentTool> = BuiltinTools, approver: ToolApprover = ToolApprover.AlwaysApprove, headers: Map<String, String> = emptyMap(), instructions: String = "", agUiEventLog: AgUiEventLog? = null): ChatBackend
The backend for this profile.
Link copied to clipboard
fun createOAuthBackend(tokens: TokenSource, tools: List<AgentTool> = BuiltinTools, approver: ToolApprover = ToolApprover.AlwaysApprove, instructions: String = ""): ChatBackend
The backend for a signed-in profile: every turn takes a fresh access token from tokens (refreshing as needed) and adds the provider's account headers.
Link copied to clipboard
Ask the provider which models it serves (for the model picker).