Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Update an agent

client.beta.agents.update(stringagentID, AgentUpdateParams { instructions, metadata, model, 6 more } body?, RequestOptionsoptions?): Agent { id, created_at, instructions, 10 more }
POST/agents/{agent_id}

Updates a reusable agent. See agent configuration.

ParametersExpand Collapse
agentID: string
minLength0
maxLength1048576
body: AgentUpdateParams { instructions, metadata, model, 6 more }
ReturnsExpand Collapse
Agent { id, created_at, instructions, 10 more }

A reusable agent scoped to the caller’s project.

id: string

The ID of the reusable agent.

minLength0
created_at: number

The Unix timestamp, in seconds, when the agent was created.

formatint64
instructions: string | null

Custom instructions appended to the agent’s default base instructions.

minLength0
metadata: Record<string, string>

Custom string key-value pairs attached to the agent.

model: string

The requested model name used for inference.

minLength0
multi_agent: MultiAgentConfig { enabled, max_concurrent_subagents }

The resolved configuration for creating and coordinating subagents.

name: string | null

A human-readable name for the agent, or null if it is unnamed.

minLength0
object: "agent"

The object type. Always agent.

reasoning: AgentReasoning { effort, summary }

The resolved reasoning configuration, including the model default for an omitted effort.

service_tier: "auto" | "default" | "flex" | 3 more

The resolved service-tier policy used for model requests.

text: AgentText { format, verbosity }

The resolved configuration for text generated by the agent.

tools: Array<PersistedAgentTool>

Tools available to the agent.

updated_at: number

The Unix timestamp, in seconds, when the agent was last updated.

formatint64

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" } });
{
  "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
}