Update an agent
client.beta.agents.update(stringagentID , AgentUpdateParams { compaction, experimental, instructions, 8 more } body ?, RequestOptionsoptions ?): Agent { id, created_at, instructions, 12 more }
POST
/agents/{agent_id}Updates a reusable agent. See agent configuration.
Update an agent
import OpenAI from "openai";
const client = new OpenAI();
const agentId = "your-agent-id";
// 1. Omit reasoning: keep its current settings while renaming the agent.
await client.beta.agents.update(agentId, { name: "Renamed" });
// 2. Send null: reset reasoning to the model's defaults.
await client.beta.agents.update(agentId, { reasoning: null });
// 3. Send an object: replace the entire reasoning configuration, without merging.
// The agent's model must support the "low" reasoning effort.
await client.beta.agents.update(agentId, { reasoning: { effort: "low" } });
200 — Example
{
"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",
"async": true
}
],
"updated_at": 0,
"compaction": {
"async": true
},
"experimental": {
"time_awareness": true
}
}Returns Examples
200 — Example
{
"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",
"async": true
}
],
"updated_at": 0,
"compaction": {
"async": true
},
"experimental": {
"time_awareness": true
}
}