Anthropic::BetaAgents
Stateful Managed Agents API resource (beta)
Constructors
new(client : Client)
SourceInstance methods
create(model : BetaManagedAgentsModelParamLike, name : String, description : String | Nil = nil, mcp_servers : Array(JSON::Any | Hash(String, JSON::Any)) | Nil = nil, metadata : Hash(String, String) | Nil = nil, multiagent : JSON::Any | Nil = nil, skills : Array(JSON::Any) | Nil = nil, system : String | Nil = nil, tools : Array(JSON::Any) | Nil = nil, betas : Array(String) = [] of String) : BetaAgent
Create a new stateful agent.
model accepts a model string / shorthand symbol, or a
BetaManagedAgentsModelConfig (or hash) for effort/speed control:
client.beta.agents.create(model: :sonnet, name: "Helper")
client.beta.agents.create(
model: Anthropic::BetaManagedAgentsModelConfig.new(
id: :sonnet,
effort: "high",
speed: "fast",
),
name: "Helper",
)
list(created_at_gte : String | Nil = nil, created_at_lte : String | Nil = nil, include_archived : Bool | Nil = nil, limit : Int32 = 20, page : String | Nil = nil, betas : Array(String) = [] of String) : BetaAgentListResponse
List agents
retrieve(agent_id : String, version : Int32 | Nil = nil, betas : Array(String) = [] of String) : BetaAgent
Retrieve an agent by ID
update(agent_id : String, version : Int32, model : BetaManagedAgentsModelParamLike | Nil = nil, name : String | Nil = nil, description : String | Nil = nil, mcp_servers : Array(JSON::Any | Hash(String, JSON::Any)) | Nil = nil, metadata : Hash(String, String) | Nil = nil, multiagent : JSON::Any | Nil = nil, skills : Array(JSON::Any) | Nil = nil, system : String | Nil = nil, tools : Array(JSON::Any) | Nil = nil, betas : Array(String) = [] of String) : BetaAgent
Update an existing agent.
model accepts the same shapes as #create (string, symbol, config
object, or hash). Omitting it leaves the stored model config unchanged.