Update an agent
Agent beta().agents().update(AgentUpdateParamsparams = AgentUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/agents/{agent_id}
Updates a reusable agent. See agent configuration.
Update an agent
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.JsonValue;
import com.openai.models.beta.agents.AgentReasoningParam;
import com.openai.models.beta.agents.AgentUpdateParams;
public class AgentUpdateExample {
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
String agentId = "your-agent-id";
// 1. Omit reasoning: keep its current settings while renaming the agent.
client.beta().agents().update(AgentUpdateParams.builder()
.agentId(agentId)
.name("Renamed")
.build());
// 2. Send null: reset reasoning to the model's defaults.
client.beta().agents().update(AgentUpdateParams.builder()
.agentId(agentId)
.reasoning(JsonValue.from(null))
.build());
// 3. Send an object: replace the entire reasoning configuration, without merging.
// The agent's model must support the "low" reasoning effort.
client.beta().agents().update(AgentUpdateParams.builder()
.agentId(agentId)
.reasoning(AgentReasoningParam.builder()
.effort(AgentReasoningParam.Effort.LOW)
.build())
.build());
}
}
{
"id": "id",
"created_at": 0,
"instructions": "instructions",
"metadata": {
"foo": "string"
},
"model": "model",
"multi_agent": {
"enabled": true,
"max_concurrent_subagents": 1
},
"name": "name",
"object": "agent",
"reasoning": {
"effort": "none",
"summary": "concise"
},
"service_tier": "auto",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"tools": [
{
"defer_loading": true,
"description": "description",
"name": "name",
"parameters": {
"foo": "bar"
},
"type": "function"
}
],
"updated_at": 0
}Returns Examples
{
"id": "id",
"created_at": 0,
"instructions": "instructions",
"metadata": {
"foo": "string"
},
"model": "model",
"multi_agent": {
"enabled": true,
"max_concurrent_subagents": 1
},
"name": "name",
"object": "agent",
"reasoning": {
"effort": "none",
"summary": "concise"
},
"service_tier": "auto",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"tools": [
{
"defer_loading": true,
"description": "description",
"name": "name",
"parameters": {
"foo": "bar"
},
"type": "function"
}
],
"updated_at": 0
}