Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.litellm-agent-platform.ai/llms.txt

Use this file to discover all available pages before exploring further.

Updates one or more fields on an existing agent. Fields you omit are left unchanged — an empty body is a no-op.

Request

PATCH /api/v1/managed_agents/agents/{agent_id}
Headers
HeaderValue
AuthorizationBearer <MASTER_KEY>
Content-Typeapplication/json

Path parameters

agent_id
string
required
The unique ID of the agent to update.

Body parameters

All fields are optional. Include only the fields you want to change.
name
string
New human-readable name for the agent.
prompt
string
New system prompt. Replaces the existing prompt entirely. To append a skill, use the attach skill endpoint instead.
model
string
New LiteLLM model string, e.g. anthropic/claude-opus-4-7. Takes effect on the next session create.
branch
string
New default Git branch. Takes effect on the next session create.
pfp_url
string
New profile picture URL.
mcp_servers
string[]
New list of MCP server connection strings. Replaces the existing list.
harness_image
string
Override the container image for the agent’s harness. Useful for pinning a specific image version. If omitted, the platform resolves the image from the environment’s K8S_HARNESS_IMAGE* variables at session create time.
env_vars
object
Replaces the agent’s entire env var map. The new map must satisfy the same constraints as agent creation (max 50 keys, ≤ 16 KB, no reserved keys).
env_vars replaces the entire map — it is not merged with existing values. To remove a single key, send the map without that key. Reserved keys stored internally (such as AGENT_REQUIREMENTS) are preserved automatically.

Response

Returns the updated ApiAgent object. See List agents for the full field reference.

Example

curl -X PATCH "https://<your-platform-host>/api/v1/managed_agents/agents/agt_01j9xyz" \
  -H "Authorization: Bearer $MASTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "pr-reviewer-v2",
    "model": "anthropic/claude-opus-4-7",
    "env_vars": {
      "GITHUB_TOKEN": "ghp_new_token"
    }
  }'
{
  "id": "agt_01j9xyz",
  "name": "pr-reviewer-v2",
  "model": "anthropic/claude-opus-4-7",
  "prompt": "You are a senior engineer who reviews pull requests.",
  "harness_id": "claude-agent-sdk",
  "supports_tui": false,
  "repo_url": "https://github.com/BerriAI/litellm",
  "branch": "main",
  "pfp_url": null,
  "mcp_servers": [],
  "env_vars": {
    "GITHUB_TOKEN": "ghp_new_token"
  },
  "attached_skill_ids": [],
  "allow_out": [],
  "deny_out": [],
  "created_at": "2025-05-01T12:00:00.000Z"
}