For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Add a model
Add a model from a second provider in the kagent UI, and run an agent on it beside your default model.
Use case: your team wants to run an agent on a different provider, or to compare two models on the same task.
An agent reaches its model through a model configuration, which names a provider, a model, and where the API key is stored. The installation created one, default-model-config, from the API key that you set. In this tutorial, you add a second configuration for another provider in the kagent UI, and create an agent that uses it. Your other agents keep the model that they have.
This tutorial stands on its own. You do not need any of the projects to follow it.
Before you begin
- Install kagent.
- Have an API key for the provider that you want to add. This tutorial uses Anthropic.
- Open the kagent UI with
kagent dashboard.
Add the model

In the sidebar, click Models, and then click New Model.
From the Provider list, choose a provider, such as Anthropic.
From the Model list, choose a model, such as
claude-sonnet-5-5. To use a model that is not listed, type its name.Leave Name empty to name the configuration after the model, and leave Namespace as
kagent.Under Authentication, leave API key selected, and enter your API key. kagent stores the key in a Kubernetes Secret that the controller creates.
Click Create model. The Models page lists the new configuration with its provider, its model, and the Secret that holds the key.
Run an agent on the new model
Create an agent that uses the new configuration, so that you can try the model without changing the agents that you already have.
In the sidebar, click Agents, and then click New Agent.
In the Name field, enter
second-opinion.In the Template section, select Inline, and fill in the template.
Field Value Model configuration The configuration that you created, such as kagent/claude-sonnet-5-5.Description Answers on a second modelSystem prompt You are a concise, helpful assistant.Click Create agent, and then click Refresh until the agent is Ready.
To compare the two models, send the same message to this agent and to an agent that uses default-model-config.
To move an existing agent to the new model instead, open the agent’s edit form, choose the configuration from the Model configuration list, and click Save agent.
YAML version
Everything that you did in the UI is stored as Kubernetes resources. To create the same resources from the command line, or to keep them in a Git repository, apply this YAML. In the UI, kagent creates the Secret for you. From the command line, you create it yourself.
The Secret with the API key, and the model configuration
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: claude-sonnet-5-5
namespace: kagent
stringData:
ANTHROPIC_API_KEY: your-api-key-here
---
apiVersion: api.kagent.dev/v1alpha3
kind: ModelConfig
metadata:
name: claude-sonnet-5-5
namespace: kagent
spec:
provider: Anthropic
model: claude-sonnet-5-5
apiKeySecret: claude-sonnet-5-5
apiKeySecretKey: ANTHROPIC_API_KEY
stream: true
EOF