curl --request PUT \
  --url http://127.0.0.1:47334/api/projects/mindsdb/agents/my_agent \
  --header 'Content-Type: application/json' \
  --data '{
  "agent": {
    "model": {
        "provider": "openai",
        "model_name": "gpt-4.1",
        "api_key": "sk-xxx"
    }
  }
}'

{
  "id": 197,
  "name": "my_agent",
  "project_id": 1,
  "created_at": "2025-07-09 12:58:24.868202",
  "updated_at": "2025-07-09 12:58:24.868199",
  "data": {
        "knowledge_bases": ["my_project.my_kb"],
        "tables": ["my_data_source.my_table"]
  },
  "model": {
    "provider": "openai",
    "model_name": "gpt-4.1",
    "api_key": "sk-xxx"
  },
  "prompt_template": "my_project.my_kb stores documentation of MindsDB, my_data_source.my_table stores documentation of MindsDB"
}
PUT /api/projects/{project_name}/agents/{agent_name} This API endpoint updates an agent using the PUT method.
Learn more about agents and the available parameters following this doc page.

Path Parameters

project_name
string
required
Defines the project where the agents are located. Note that the default project name is mindsdb.
agent_name
string
required
Defines the agent name.

Body

name
string
Name of the agent.
model
string
Stores parameters of the model, including provider, model_name, and api_key.
data
string
Stores data connected to an agent, including tables and knowledge_bases.
prompt_template
string
Stores instruction to an agent. This should contain the description of connected data.

Response

id
string
required
Unique identifier for the agent.
name
string
required
The name assigned to the agent.
project_id
string
required
The ID of the project where the agent resides.
created_at
string
required
Timestamp indicating when the agent was created.
updated_at
string
required
Timestamp indicating when the agent was last updated.
Stores data connected to an agent, including tables and knowledge_bases.
Stores parameters of the model, including provider, model_name, and api_key.
Stores instruction to an agent. This should contain the description of connected data.
curl --request PUT \
  --url http://127.0.0.1:47334/api/projects/mindsdb/agents/my_agent \
  --header 'Content-Type: application/json' \
  --data '{
  "agent": {
    "model": {
        "provider": "openai",
        "model_name": "gpt-4.1",
        "api_key": "sk-xxx"
    }
  }
}'

{
  "id": 197,
  "name": "my_agent",
  "project_id": 1,
  "created_at": "2025-07-09 12:58:24.868202",
  "updated_at": "2025-07-09 12:58:24.868199",
  "data": {
        "knowledge_bases": ["my_project.my_kb"],
        "tables": ["my_data_source.my_table"]
  },
  "model": {
    "provider": "openai",
    "model_name": "gpt-4.1",
    "api_key": "sk-xxx"
  },
  "prompt_template": "my_project.my_kb stores documentation of MindsDB, my_data_source.my_table stores documentation of MindsDB"
}