### Install Go SDK Source: https://platform.claude.com/docs/en/managed-agents/quickstart Install the Anthropic SDK for Go using go get. ```bash go get github.com/anthropics/anthropic-sdk-go ``` -------------------------------- ### Start a Session (Python) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Creates a new session using the Anthropic Python client, linking a specific agent and environment. The session is given a title 'Quickstart session'. ```python session = client.beta.sessions.create( agent=agent.id, environment_id=environment.id, title="Quickstart session", ) print(f"Session ID: {session.id}") ``` -------------------------------- ### Start a Session (TypeScript) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Initiates a new session using the Anthropic TypeScript client, associating it with a given agent and environment ID. The session is titled 'Quickstart session'. ```typescript const session = await client.beta.sessions.create({ agent: agent.id, ``` -------------------------------- ### Start a Session with File Metadata (cURL) Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes Initiate a session targeting a self-hosted environment. Pass file references in the metadata field to make session-specific files available. This example uses cURL. ```bash curl -sS --fail-with-body https://api.anthropic.com/v1/sessions \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d @- <beta->sessions->create( agent: $agent->id, environmentID: $environment->id, metadata: ['input_file' => 's3://my-bucket/data.csv'], ); ``` -------------------------------- ### Create Agent with Skills (Go) Source: https://platform.claude.com/docs/en/managed-agents/skills Create an agent with skills using the Go SDK. This example shows how to structure the `Skills` parameter for both Anthropic and custom skills. ```go agent, err := client.Beta.Agents.New(ctx, anthropic.BetaAgentNewParams{ Name: "Financial Analyst", Model: anthropic.BetaManagedAgentsModelConfigParams{ ID: "claude-opus-4-8", }, System: anthropic.String("You are a financial analysis agent."), Skills: []anthropic.BetaManagedAgentsSkillParamsUnion{ {OfAnthropic: &anthropic.BetaManagedAgentsAnthropicSkillParams{ SkillID: "xlsx", Type: anthropic.BetaManagedAgentsAnthropicSkillParamsTypeAnthropic, }}, {OfCustom: &anthropic.BetaManagedAgentsCustomSkillParams{ SkillID: "skill_abc123", Type: anthropic.BetaManagedAgentsCustomSkillParamsTypeCustom, Version: anthropic.String("latest"), }}, }, }) if err != nil { panic(err) } _ = agent ``` -------------------------------- ### Start a Session with File Metadata (Ruby SDK) Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes Create a session using the Ruby SDK, targeting a self-hosted environment. Pass file references in the metadata hash for session-specific files. ```ruby session = client.beta.sessions.create( agent: agent.id, environment_id: environment.id, metadata: {input_file: "s3://my-bucket/data.csv"} ) ``` -------------------------------- ### Start a Session (Bash - cURL) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Starts a new session by referencing a previously created agent and environment. It uses cURL and requires API keys and versioning headers. ```bash session=( curl -sS --fail-with-body https://api.anthropic.com/v1/sessions \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d @- < { ["input_file"] = "s3://my-bucket/data.csv" }, }); ``` -------------------------------- ### Create Session Mounting GitHub Repository (PHP) Source: https://platform.claude.com/docs/en/managed-agents/github This PHP example shows how to create a session that mounts a GitHub repository. It uses the client library to define the agent, environment, and repository resources. ```php $session = $client->beta->sessions->create( agent: $agent->id, environmentID: $environment->id, resources: [ [ 'type' => 'github_repository', 'url' => 'https://github.com/org/repo', 'mountPath' => '/workspace/repo', 'authorizationToken' => 'ghp_your_github_token', ], ], ); ``` -------------------------------- ### Start a Session with File Metadata (CLI) Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes Initiate a session targeting a self-hosted environment using the Anthropic CLI. Pass file references in the metadata field to make session-specific files available. ```bash ant beta:sessions create \ --agent "$AGENT_ID" \ --environment-id "$ANTHROPIC_ENVIRONMENT_ID" \ --metadata '{"input_file": "s3://my-bucket/data.csv"}' ``` -------------------------------- ### Create Session in C# Source: https://platform.claude.com/docs/en/managed-agents/quickstart Create a new session using the client library in C#. This example assumes the client and necessary objects (agent, environment) are already configured. ```csharp var session = await client.Beta.Sessions.Create(new() { Agent = agent.ID, EnvironmentID = environment.ID, Title = "Quickstart session", }); Console.WriteLine($ ``` -------------------------------- ### Create Session Mounting GitHub Repository (TypeScript) Source: https://platform.claude.com/docs/en/managed-agents/github This TypeScript example shows how to create a session that mounts a GitHub repository. It uses the client library to define the agent, environment, and repository resources. ```typescript const session = await client.beta.sessions.create({ agent: agent.id, environment_id: environment.id, resources: [ { type: "github_repository", url: "https://github.com/org/repo", mount_path: "/workspace/repo", authorization_token: "ghp_your_github_token", }, ], }); ``` -------------------------------- ### Create an Environment (Go) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Creates a new environment named 'quickstart-env' with a cloud configuration and unrestricted networking using the Anthropic Go client. ```go environment, err := client.Beta.Environments.New(ctx, anthropic.BetaEnvironmentNewParams{ Name: "quickstart-env", Config: anthropic.BetaEnvironmentNewParamsConfigUnion{ OfCloud: &anthropic.BetaCloudConfigParams{ Networking: anthropic.BetaCloudConfigParamsNetworkingUnion{ OfUnrestricted: &anthropic.BetaUnrestrictedNetworkParam{}, }, }, }, }) if err != nil { panic(err) } fmt.Printf("Environment ID: %s\n", environment.ID) ``` -------------------------------- ### Create Agent with GitHub MCP Server (Java) Source: https://platform.claude.com/docs/en/managed-agents/github This Java example shows how to create an agent for GitHub MCP using the Anthropic Java SDK. It utilizes a builder pattern for configuration. ```java var agent = client.beta().agents().create(AgentCreateParams.builder() .name("Code Reviewer") .model(BetaManagedAgentsModel.CLAUDE_OPUS_4_8) .system("You are a code review assistant with access to GitHub.") .addMcpServer(BetaManagedAgentsUrlMcpServerParams.builder() .type(BetaManagedAgentsUrlMcpServerParams.Type.URL) .name("github") .url("https://api.githubcopilot.com/mcp/") .build()) .addTool(BetaManagedAgentsAgentToolset20260401Params.builder() .type(BetaManagedAgentsAgentToolset20260401Params.Type.AGENT_TOOLSET_20260401) .build()) .addTool(BetaManagedAgentsMcpToolsetParams.builder() .type(BetaManagedAgentsMcpToolsetParams.Type.MCP_TOOLSET) .mcpServerName("github") .build()) .build()); ``` -------------------------------- ### Create an Environment (PHP) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Creates a new environment named 'quickstart-env' with a cloud configuration and unrestricted networking using the Anthropic PHP client. ```php $environment = $client->beta->environments->create( name: 'quickstart-env', config: ['type' => 'cloud', 'networking' => ['type' => 'unrestricted']], ); echo "Environment ID: {$environment->id}\n"; ``` -------------------------------- ### Create a Session using Go SDK Source: https://platform.claude.com/docs/en/managed-agents/onboarding Initiate a new session for a managed agent with the Anthropic Go SDK. This example demonstrates setting the agent, environment ID, and title for the session creation. ```go session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{ Agent: anthropic.BetaSessionNewParamsAgentUnion{ OfString: anthropic.String("agent_01J8XkN5uT3vHpLqRfWdY2"), }, EnvironmentID: "env_01K2mPsT7hNwR4jXuLvCqD8", Title: anthropic.String("My first session"), }) if err != nil { panic(err) } _ = session ``` -------------------------------- ### Start a Session with a Specific Environment using cURL Source: https://platform.claude.com/docs/en/managed-agents/environments Initiate a new session, passing the environment ID to specify the sandbox configuration. Requires the `managed-agents-2026-04-01` beta header. ```bash session=$(curl -fsS https://api.anthropic.com/v1/sessions \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ --data @- <beta->files->upload( FileParam::fromResource(fopen($csvPath, 'r'), filename: 'data.csv', contentType: 'text/csv'), ); echo "File ID: {$file->id}\n"; ``` -------------------------------- ### Go Work Poller Example Snippet Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes This Go snippet demonstrates the start of a work poller implementation. The Go poller automatically calls `work.Stop` upon function return, so any session-specific blocking logic should be contained within this function. ```go package main import ( "context" "fmt" "log" "os" "github.com/anthropics/anthropic-sdk-go" "github.com/anthropics/anthropic-sdk-go/lib/environments" "github.com/anthropics/anthropic-sdk-go/option" ) func launchContainer(work *anthropic.BetaSelfHostedWork) { // Replace with your own per-session sandbox launcher. The Go poller // calls work.Stop when this function returns (it has no auto-stop // opt-out), so block here until the session completes rather than // detaching as the Python and TypeScript tabs do. ``` -------------------------------- ### Create an Environment (TypeScript) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Creates a new environment named 'quickstart-env' with a cloud configuration and unrestricted networking using the Anthropic TypeScript client. ```typescript const environment = await client.beta.environments.create({ name: "quickstart-env", config: { type: "cloud", networking: { type: "unrestricted" }, }, }); console.log(`Environment ID: ${environment.id}`); ``` -------------------------------- ### Check CLI Installation Source: https://platform.claude.com/docs/en/managed-agents/quickstart Verify the Anthropic CLI installation by checking its version. ```bash ant --version ``` -------------------------------- ### Create an Environment (Bash - cURL) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Creates a new cloud environment named 'quickstart-env' with unrestricted networking using cURL. It requires the ANTHROPIC_API_KEY and specific API version headers. ```bash environment=( curl -sS --fail-with-body https://api.anthropic.com/v1/environments \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d @- <<'EOF' { "name": "quickstart-env", "config": { "type": "cloud", "networking": {"type": "unrestricted"} } } EOF ) ENVIRONMENT_ID=$(jq -er '.id' <<<"$environment") echo "Environment ID: $ENVIRONMENT_ID" ``` -------------------------------- ### Install CLI with Homebrew (macOS) Source: https://platform.claude.com/docs/en/managed-agents/quickstart Install the Anthropic CLI using Homebrew on macOS. ```bash brew install anthropics/tap/ant ``` -------------------------------- ### List and Download Files (Go) Source: https://platform.claude.com/docs/en/managed-agents/define-outcomes Lists files from a session and downloads the first one to a local file. Requires context and error handling. ```go // List files produced by this session files, err := client.Beta.Files.List(ctx, anthropic.BetaFileListParams{ // pass ScopeID: anthropic.String(session.ID) to filter }) if err != nil { panic(err) } for _, file := range files.Data { fmt.Println(file.ID, file.Filename) } // Download a file if len(files.Data) > 0 { resp, err := client.Beta.Files.Download(ctx, files.Data[0].ID, anthropic.BetaFileDownloadParams{}) if err != nil { panic(err) } defer resp.Body.Close() fileContent, err := io.ReadAll(resp.Body) if err != nil { panic(err) } if err := os.WriteFile("/tmp/output.txt", fileContent, 0o644); err != nil { panic(err) } } ``` -------------------------------- ### Example Rubric for DCF Model Source: https://platform.claude.com/docs/en/managed-agents/define-outcomes This is an example of a markdown document used to define grading criteria for an artifact. It structures the evaluation into explicit, gradeable criteria. ```markdown # DCF Model Rubric ## Revenue Projections - Uses historical revenue data from the last 5 fiscal years - Projects revenue for at least 5 years forward - Growth rate assumptions are explicitly stated and reasonable ## Cost Structure - COGS and operating expenses are modeled separately - Margins are consistent with historical trends or deviations are justified ## Discount Rate - WACC is calculated with stated assumptions for cost of equity and cost of debt - Beta, risk-free rate, and equity risk premium are sourced or justified ## Terminal Value - Uses either perpetuity growth or exit multiple method (stated which) - Terminal growth rate does not exceed long-term GDP growth ## Output Quality - All figures are in a single .xlsx file with clearly labeled sheets - Key assumptions are on a separate "Assumptions" sheet - Sensitivity analysis on WACC and terminal growth rate is included ``` -------------------------------- ### Create Session with Mounted File (Python) Source: https://platform.claude.com/docs/en/managed-agents/files Use the Python SDK to create a session and attach a file resource. The mount_path is optional but recommended for clarity. ```python session = client.beta.sessions.create( agent=agent.id, environment_id=environment.id, resources=[ { "type": "file", "file_id": file.id, "mount_path": "/workspace/data.csv", }, ], ) ``` -------------------------------- ### Install Java SDK Source: https://platform.claude.com/docs/en/managed-agents/quickstart Add the Anthropic SDK for Java to your Gradle project dependencies. ```groovy implementation("com.anthropic:anthropic-java:2.35.0") ``` -------------------------------- ### Dockerfile for Sandbox Worker Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes Defines a Docker image for running workers in isolated sandboxes. Installs `ant` and sets up the entrypoint. ```dockerfile FROM your-base-image ARG ANT_VERSION=1.10.0 ARG TARGETARCH RUN ARCH=$([ "$TARGETARCH" = "arm64" ] && echo arm64 || echo amd64) && \ curl -fsSL "https://github.com/anthropics/anthropic-cli/releases/download/v${ANT_VERSION}/ant_${ANT_VERSION}_linux_${ARCH}.tar.gz" \ | tar -xz -C /usr/local/bin ant WORKDIR /workspace VOLUME /mnt/session/outputs ENTRYPOINT ["ant", "beta:worker", "run"] ``` -------------------------------- ### Retrieve a Memory (PHP) Source: https://platform.claude.com/docs/en/managed-agents/memory Uses the PHP client to get memory content. Pass memory and store IDs directly. ```php $retrieved = $client->beta->memoryStores->memories->retrieve($mem->id, memoryStoreID: $store->id); echo "{$retrieved->content}\n"; ``` -------------------------------- ### Update a memory Source: https://platform.claude.com/docs/en/managed-agents/memory Modifies an existing memory by ID. You can change `content`, `path` (a rename), or both. The example renames a memory to an archive path. ```APIDOC ## POST /v1/memory_stores/$store_id/memories/$mem_id ### Description Modifies an existing memory by ID. You can change `content`, `path` (a rename), or both. ### Method POST ### Endpoint /v1/memory_stores/$store_id/memories/$mem_id ### Parameters #### Path Parameters - **store_id** (string) - Required - The ID of the memory store. - **mem_id** (string) - Required - The ID of the memory to update. #### Request Body - **path** (string) - Optional - The new path for the memory. Used for renaming. - **content** (string) - Optional - The new content for the memory. ### Request Example ```json { "path": "/archive/2026_q1_formatting.md" } ``` ### Response #### Success Response (200) This endpoint returns an empty response upon successful update. #### Response Example (No response body for success) ``` -------------------------------- ### Run In-process Worker with ant CLI Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes Starts an in-process worker that polls for work items. The worker manages its own environment and tool execution. ```bash ant beta:worker poll \ --workdir "/workspace" ``` -------------------------------- ### Session Thread Status Idle Event Source: https://platform.claude.com/docs/en/managed-agents/multi-agent An example of the JSON event structure indicating a session thread is idle and requires action, such as a tool confirmation. ```json { "type": "session.thread_status_idle", "id": "sevt_01ABC...", "session_thread_id": "sth_01DEF...", "agent_name": "code-reviewer", "stop_reason": { "type": "requires_action", "event_ids": ["toolu_01XYZ..."] } } ``` -------------------------------- ### Interrupt and Archive Thread using C# SDK Source: https://platform.claude.com/docs/en/managed-agents/multi-agent Interrupt a thread and archive it using the Anthropic C# SDK. This example demonstrates asynchronous calls. ```csharp await client.Beta.Sessions.Events.Send(session.ID, new() { Events = [ new BetaManagedAgentsUserInterruptEventParams { Type = BetaManagedAgentsUserInterruptEventParamsType.UserInterrupt, SessionThreadID = thread.ID, }, ], }); archived = await client.Beta.Sessions.Threads.Archive(thread.ID, new() { SessionID = session.ID }); Console.WriteLine($"{archived.Status} {archived.ArchivedAt}"); ``` -------------------------------- ### Create Agent with Skills (TypeScript) Source: https://platform.claude.com/docs/en/managed-agents/skills Instantiate an agent with skills using the Anthropic TypeScript SDK. This example demonstrates attaching pre-built and custom skills. ```typescript const agent = await client.beta.agents.create({ name: "Financial Analyst", model: "claude-opus-4-8", system: "You are a financial analysis agent.", skills: [ { type: "anthropic", skill_id: "xlsx" }, { type: "custom", skill_id: "skill_abc123", version: "latest" } ] }); ``` -------------------------------- ### Run Sandbox Worker with ant CLI Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes Starts the `ant` CLI worker, configured to use a provided script to spawn new sandboxes for each session. ```bash ant beta:worker poll \ --on-work ./spawn.sh ``` -------------------------------- ### Outcome Evaluation Start Event Source: https://platform.claude.com/docs/en/managed-agents/define-outcomes Emitted when the grader begins evaluating an outcome for a specific iteration. Includes the outcome ID and the current iteration number. ```json { "type": "span.outcome_evaluation_start", "id": "sevt_01def...", "outcome_id": "outc_01a...", "iteration": 0, "processed_at": "2026-03-25T14:01:45Z" } ``` -------------------------------- ### Create Environment with Packages (Go) Source: https://platform.claude.com/docs/en/managed-agents/environments Use the Go SDK to create a new managed environment, specifying Python and Node.js packages. ```go environment, err := client.Beta.Environments.New(ctx, anthropic.BetaEnvironmentNewParams{ Name: "data-analysis", Config: anthropic.BetaEnvironmentNewParamsConfigUnion{ OfCloud: &anthropic.BetaCloudConfigParams{ Packages: anthropic.BetaPackagesParams{ Pip: []string{"pandas", "numpy", "scikit-learn"}, Npm: []string{"express"}, }, Networking: anthropic.BetaCloudConfigParamsNetworkingUnion{ OfUnrestricted: &anthropic.BetaUnrestrictedNetworkParam{}, }, }, }, }) if err != nil { panic(err) } _ = environment ``` -------------------------------- ### Interrupt and Archive Thread using Ruby SDK Source: https://platform.claude.com/docs/en/managed-agents/multi-agent Interrupt a thread and archive it using the Anthropic Ruby SDK. This example uses the `send_` method for events. ```ruby client.beta.sessions.events.send_( session.id, events: [{type: "user.interrupt", session_thread_id: thread.id}] ) archived = client.beta.sessions.threads.archive(thread.id, session_id: session.id) puts "#{archived.status} #{archived.archived_at}" ``` -------------------------------- ### Create Self-Hosted Environment via Python SDK Source: https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes Instantiate the Anthropic Python client and use the beta.environments.create method to set up a self-hosted environment. The environment ID is printed to the console. ```python import anthropic client = anthropic.Anthropic() environment = client.beta.environments.create( name="self-hosted", config={"type": "self_hosted"} ) print(environment.id) ``` -------------------------------- ### Create Session with Mounted File (Go) Source: https://platform.claude.com/docs/en/managed-agents/files Use the Go SDK to create a session and mount a file. The anthropic.BetaSessionNewParams struct is used for session creation. ```go session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{ Agent: anthropic.BetaSessionNewParamsAgentUnion{ OfString: anthropic.String(agent.ID), }, EnvironmentID: environment.ID, Resources: []anthropic.BetaSessionNewParamsResourceUnion{{ OfFile: &anthropic.BetaManagedAgentsFileResourceParams{ Type: anthropic.BetaManagedAgentsFileResourceParamsTypeFile, FileID: file.ID, MountPath: anthropic.String("/workspace/data.csv"), }, }}, }) if err != nil { panic(err) } ``` -------------------------------- ### Interrupt and Archive Thread using Java SDK Source: https://platform.claude.com/docs/en/managed-agents/multi-agent Interrupt a thread and archive it using the Anthropic Java SDK. This example shows how to build the parameters for these actions. ```java client.beta().sessions().events().send( session.id(), EventSendParams.builder() .addEvent(BetaManagedAgentsUserInterruptEventParams.builder() .type(BetaManagedAgentsUserInterruptEventParams.Type.USER_INTERRUPT) .sessionThreadId(thread.id()) .build()) .build()); archived = client.beta().sessions().threads().archive( thread.id(), ThreadArchiveParams.builder() .sessionId(session.id()) .build()); IO.println(archived.status() + " " + archived.archivedAt()); ``` -------------------------------- ### Example Event Payload Structure Source: https://platform.claude.com/docs/en/managed-agents/webhooks This JSON structure represents a typical event payload, including type, ID, creation timestamp, and data specific to the event. ```json { "type": "event", "id": "event_01ABC...", "created_at": "2026-03-18T14:05:22Z", "data": { "type": "session.status_idled", "id": "sesn_01XYZ...", "organization_id": "8a3d2f1e-...", "workspace_id": "c7b0e4d9-..." } } ``` -------------------------------- ### Rebuild Memory Store using TypeScript Source: https://platform.claude.com/docs/en/managed-agents/dreams TypeScript example to find the memory store output and create a new session with the specified memory store ID. ```typescript // After the dream ends, the output holds the rebuilt memory store const output = dream.outputs.find((entry) => entry.type === "memory_store"); const outputStoreId = output!.memory_store_id; await client.beta.sessions.create({ agent: agentId, environment_id: environmentId, resources: [ { type: "memory_store", memory_store_id: outputStoreId }, ], }); ``` -------------------------------- ### Create Session with Mounted File (PHP) Source: https://platform.claude.com/docs/en/managed-agents/files Use the PHP SDK to create a session and attach a file. The BetaManagedAgentsFileResourceParams class is used for file resources. ```php $session = $client->beta->sessions->create( agent: $agent->id, environmentID: $environment->id, resources: [ BetaManagedAgentsFileResourceParams::with( type: 'file', fileID: $file->id, mountPath: '/workspace/data.csv', ), ], ); ``` -------------------------------- ### List Resources and Rotate Token (Ruby) Source: https://platform.claude.com/docs/en/managed-agents/github Manage session resources with the Anthropic Ruby SDK. This example demonstrates listing resources and rotating an authorization token. Ensure the SDK is required and the client is initialized. ```ruby # List resources on the session listed = client.beta.sessions.resources.list(session.id) repo_resource_id = listed.data.first.id puts repo_resource_id # "sesrsc_01ABC..." # Rotate the authorization token client.beta.sessions.resources.update( repo_resource_id, session_id: session.id, authorization_token: "ghp_your_new_github_token" ) ``` -------------------------------- ### Start a Session with a Specific Environment using TypeScript SDK Source: https://platform.claude.com/docs/en/managed-agents/environments Create a new session, specifying the agent and environment IDs using the Anthropic TypeScript SDK. ```typescript const session = await client.beta.sessions.create({ agent: agent.id, environment_id: environment.id, }); ``` -------------------------------- ### Create Session with Latest Agent Version Source: https://platform.claude.com/docs/en/managed-agents/sessions Use this method to start a new session with the most recent version of a managed agent. Requires agent and environment IDs. ```bash session=$(curl -fsSL https://api.anthropic.com/v1/sessions \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d @- <