Create Session
$ ant beta:sessions createPOST/v1/sessions
Create Session
Parameters
--agent: string or BetaManagedAgentsAgentParams { id, type, version } or BetaManagedAgentsAgentWithOverridesParams { id, type, mcp_servers, 5 more }
Body param: Agent identifier. Accepts the agent ID string, which pins the latest version for the session, or an agent object with both id and version specified.
--initial-event: optional array of BetaManagedAgentsUserMessageEventParams { content, type } or BetaManagedAgentsUserDefineOutcomeEventParams { description, rubric, type, max_iterations }
Body param: Initial events to send to the session at creation, processed in order. Supports user.message and user.define_outcome events. Maximum 50 events.
--resource: optional array of BetaManagedAgentsGitHubRepositoryResourceParams { authorization_token, type, url, 2 more } or BetaManagedAgentsFileResourceParams { file_id, type, mount_path } or BetaManagedAgentsMemoryStoreResourceParam { memory_store_id, type, access, instructions }
Body param: Resources (e.g. repositories, files) to mount into the session's container.
Header param: Optional header to specify the beta version(s) you want to use.
Returns
Create Session
ant beta:sessions create \
--api-key my-anthropic-api-key \
--agent agent_011CZkYpogX7uDKUyvBTophP \
--environment-id env_011CZkZ9X2dpNyB7HsEFoRfW{
"id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"agent": {
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"description": "A general-purpose starter agent.",
"mcp_servers": [
{
"name": "example-mcp",
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"model": {
"id": "claude-opus-5",
"effort": {
"type": "low"
},
"inference_geo": "inference_geo",
"speed": "standard"
},
"multiagent": {
"agents": [
{
"id": "agent_011CZkYqphY8vELVzwCUpqiQ",
"description": "A focused research subagent.",
"mcp_servers": [
{
"name": "example-mcp",
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"model": {
"id": "claude-opus-5",
"effort": {
"type": "low"
},
"inference_geo": "inference_geo",
"speed": "standard"
},
"name": "Researcher",
"skills": [
{
"skill_id": "xlsx",
"type": "anthropic",
"version": "1"
}
],
"system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
"tools": [
{
"configs": [
{
"enabled": true,
"name": "bash",
"permission_policy": {
"type": "always_allow"
},
"type": "bash"
}
],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"type": "agent_toolset_20260401"
}
],
"type": "agent",
"version": 1
}
],
"type": "coordinator"
},
"name": "My First Agent",
"skills": [
{
"skill_id": "xlsx",
"type": "anthropic",
"version": "1"
},
{
"skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx",
"type": "custom",
"version": "2"
}
],
"system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
"tools": [
{
"configs": [
{
"enabled": true,
"name": "bash",
"permission_policy": {
"type": "always_allow"
},
"type": "bash"
}
],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"type": "agent_toolset_20260401"
}
],
"type": "agent",
"version": 1
},
"archived_at": null,
"budget": {
"max_list_cost": {
"amount": "2500",
"currency": "USD"
},
"type": "limit"
},
"created_at": "2026-03-15T10:00:00Z",
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"metadata": {},
"outcome_evaluations": [
{
"completed_at": "2026-03-15T10:02:31Z",
"description": "Produce a 2-page summary as summary.md",
"explanation": "All five sections present with inline citations.",
"iteration": 0,
"outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP",
"result": "satisfied",
"type": "outcome_evaluation"
}
],
"resources": [
{
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"created_at": "2026-03-15T10:00:00Z",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"type": "file",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"created_at": "2026-03-15T10:00:00Z",
"mount_path": "/workspace/example-repo",
"type": "github_repository",
"updated_at": "2026-03-15T10:00:00Z",
"url": "https://github.com/example-org/example-repo",
"checkout": {
"name": "main",
"type": "branch"
}
}
],
"stats": {
"active_seconds": 0,
"duration_seconds": 0
},
"status": "idle",
"title": "Order #1234 inquiry",
"type": "session",
"updated_at": "2026-03-15T10:00:00Z",
"usage": {
"active_seconds": 0,
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
},
"cache_read_input_tokens": 0,
"input_tokens": 0,
"list_cost": {
"amount": "2500",
"currency": "USD"
},
"output_tokens": 0,
"server_tool_use": {
"web_fetch_requests": 0,
"web_search_requests": 3
}
},
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"deployment_id": "deployment_id"
}Returns Examples
{
"id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"agent": {
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"description": "A general-purpose starter agent.",
"mcp_servers": [
{
"name": "example-mcp",
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"model": {
"id": "claude-opus-5",
"effort": {
"type": "low"
},
"inference_geo": "inference_geo",
"speed": "standard"
},
"multiagent": {
"agents": [
{
"id": "agent_011CZkYqphY8vELVzwCUpqiQ",
"description": "A focused research subagent.",
"mcp_servers": [
{
"name": "example-mcp",
"type": "url",
"url": "https://example-server.modelcontextprotocol.io/sse"
}
],
"model": {
"id": "claude-opus-5",
"effort": {
"type": "low"
},
"inference_geo": "inference_geo",
"speed": "standard"
},
"name": "Researcher",
"skills": [
{
"skill_id": "xlsx",
"type": "anthropic",
"version": "1"
}
],
"system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
"tools": [
{
"configs": [
{
"enabled": true,
"name": "bash",
"permission_policy": {
"type": "always_allow"
},
"type": "bash"
}
],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"type": "agent_toolset_20260401"
}
],
"type": "agent",
"version": 1
}
],
"type": "coordinator"
},
"name": "My First Agent",
"skills": [
{
"skill_id": "xlsx",
"type": "anthropic",
"version": "1"
},
{
"skill_id": "skill_011CZkZFNu9hAbo3jZPRgTlx",
"type": "custom",
"version": "2"
}
],
"system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
"tools": [
{
"configs": [
{
"enabled": true,
"name": "bash",
"permission_policy": {
"type": "always_allow"
},
"type": "bash"
}
],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_ask"
}
},
"type": "agent_toolset_20260401"
}
],
"type": "agent",
"version": 1
},
"archived_at": null,
"budget": {
"max_list_cost": {
"amount": "2500",
"currency": "USD"
},
"type": "limit"
},
"created_at": "2026-03-15T10:00:00Z",
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"metadata": {},
"outcome_evaluations": [
{
"completed_at": "2026-03-15T10:02:31Z",
"description": "Produce a 2-page summary as summary.md",
"explanation": "All five sections present with inline citations.",
"iteration": 0,
"outcome_id": "outc_011CZkZRSw2kEfs6ncTVljxP",
"result": "satisfied",
"type": "outcome_evaluation"
}
],
"resources": [
{
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"created_at": "2026-03-15T10:00:00Z",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"type": "file",
"updated_at": "2026-03-15T10:00:00Z"
},
{
"id": "sesrsc_011CZkZCKr6eXyl0gWMOdQiu",
"created_at": "2026-03-15T10:00:00Z",
"mount_path": "/workspace/example-repo",
"type": "github_repository",
"updated_at": "2026-03-15T10:00:00Z",
"url": "https://github.com/example-org/example-repo",
"checkout": {
"name": "main",
"type": "branch"
}
}
],
"stats": {
"active_seconds": 0,
"duration_seconds": 0
},
"status": "idle",
"title": "Order #1234 inquiry",
"type": "session",
"updated_at": "2026-03-15T10:00:00Z",
"usage": {
"active_seconds": 0,
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
},
"cache_read_input_tokens": 0,
"input_tokens": 0,
"list_cost": {
"amount": "2500",
"currency": "USD"
},
"output_tokens": 0,
"server_tool_use": {
"web_fetch_requests": 0,
"web_search_requests": 3
}
},
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"deployment_id": "deployment_id"
}