Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

sessions changedmanaged-agents/sessions

Nearest release: v2.1.304, published under an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+9added
Lines−32removed
From line 193 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits18to this page, all time

The whole hunk

from line 193, old and new numbered
/
lines
from line 193
193193 
194194<CodeGroup>
195195 ```bash cURL
196 seeded_session=$(curl -fsSL https://api.anthropic.com/v1/sessions \
196 curl -fsSL https://api.anthropic.com/v1/sessions \
197197 -H "x-api-key: $ANTHROPIC_API_KEY" \
198198 -H "anthropic-version: 2023-06-01" \
199199 -H "anthropic-beta: managed-agents-2026-04-01" \
from line 208
208208 }
209209 ]
210210 }'
211 )
212 SEEDED_SESSION_ID=$(jq -r '.id' <<< "$seeded_session")
213 
214 # initial_events aren't echoed on the create response; list the session's
215 # events to see the seeded message.
216 seeded_events=$(curl -fsSL \
217 "https://api.anthropic.com/v1/sessions/$SEEDED_SESSION_ID/events" \
218 -H "x-api-key: $ANTHROPIC_API_KEY" \
219 -H "anthropic-version: 2023-06-01" \
220 -H "anthropic-beta: managed-agents-2026-04-01")
221 echo "Seeded event: $(jq -r \
222 '.data[] | select(.type == "user.message") | .content[0].text' <<< "$seeded_events")"
223211 ```
224212 
225213 ```bash CLI
226 SEEDED_SESSION_ID=$(ant beta:sessions create \
227 --transform id --raw-output <<YAML
214 ant beta:sessions create <<YAML
228215 agent: $AGENT_ID
229216 environment_id: $ENVIRONMENT_ID
230217 initial_events:
from line 220
233220 - type: text
234221 text: List the files in the working directory.
235222 YAML
236 )
237 
238 # initial_events aren't echoed on the create response; list the session's
239 # events to see the seeded message.
240 echo "Seeded event: $(ant beta:sessions:events list \
241 --session-id "$SEEDED_SESSION_ID" \
242 --format raw \
243 --transform 'data.#(type=="user.message").content.0.text' --raw-output)"
244223 ```
245224 
246225 ```python Python
from line 414
435414 ```
436415</CodeGroup>
437416 
417`initial_events` (java, php: `initialEvents`; csharp, go: `InitialEvents`) are not echoed on the create response. To see the seeded message, list the session's events.
418 
438419No other event type is accepted. Events that respond to an agent turn (`user.tool_confirmation`, `user.tool_result`, and `user.custom_tool_result`) aren't accepted because no agent turn exists yet, and `user.interrupt` isn't accepted because there is no turn to stop. Unlike `initial_events` (java, php: `initialEvents`; csharp, go: `InitialEvents`) on a scheduled deployment, a session's `initial_events` (java, php: `initialEvents`; csharp, go: `InitialEvents`) don't accept `system.message`.
439420 
440421Each event in `initial_events` (java, php: `initialEvents`; csharp, go: `InitialEvents`) is validated and persisted before the create response returns, in list order, with a server-assigned ID, exactly as if you had posted it to the [send events](https://platform.claude.com/docs/en/managed-agents/events-and-streaming#send-events) endpoint immediately after creation. Per-event content rules are also the same as on that endpoint. An empty list is equivalent to omitting the field. Validation is all-or-nothing: if any event fails validation, the whole request is rejected and no session is created.
from line 616
635616 
636617Because a `model` (csharp, go: `Model`) override replaces the agent's `model` (csharp, go: `Model`) object in full, it also sets or clears the model's [inference geo](https://platform.claude.com/docs/en/manage-claude/data-residency) pin for the session: an override that includes `inference_geo` (java, php: `inferenceGeo`; csharp, go: `InferenceGeo`) pins the geography that serves the session's model requests, and one that omits it clears the agent's pin so the session follows the workspace's `default_inference_geo`. The overridden value is validated against the workspace's `allowed_inference_geos` when the session is created.
637618 
638The following example starts a session from an agent whose model has no geo pin, pins the session's model requests to US inference by including `inference_geo` (java, php: `inferenceGeo`; csharp, go: `InferenceGeo`) in the `model` (csharp, go: `Model`) override, and prints the value echoed in the response's `agent.model` (csharp, go: `Agent.Model`):
619The following example starts a session from an agent whose model has no geo pin, and pins the session's model requests to US inference by including `inference_geo` (java, php: `inferenceGeo`; csharp, go: `InferenceGeo`) in the `model` (csharp, go: `Model`) override. The response echoes the value in `agent.model` (csharp, go: `Agent.Model`):
639620 
640621<CodeGroup>
641622 ```bash cURL
642 # Replaces the agent's `model` in full: restate `id`, add `inference_geo` to pin.
643 session=$(curl -fsSL https://api.anthropic.com/v1/sessions \
623 # Replaces the whole model object of the agent: restate id, add inference_geo to pin.
624 curl -fsSL https://api.anthropic.com/v1/sessions \
644625 -H "x-api-key: $ANTHROPIC_API_KEY" \
645626 -H "anthropic-version: 2023-06-01" \
646627 -H "anthropic-beta: managed-agents-2026-04-01" \
from line 634
653634 },
654635 "environment_id": "'"$ENVIRONMENT_ID"'"
655636 }'
656 )
657 echo "Inference geo: $(jq -r '.agent.model.inference_geo' <<< "$session")"
658637 ```
659638 
660639 ```bash CLI
661 # Replaces the agent's `model` in full: restate `id`, add `inference_geo` to pin.
662 session=$(ant beta:sessions create <<YAML
640 # Replaces the whole model object of the agent: restate id, add inference_geo to pin.
641 ant beta:sessions create <<YAML
663642 agent:
664643 type: agent_with_overrides
665644 id: $AGENT_ID
from line 647
668647 inference_geo: us
669648 environment_id: $ENVIRONMENT_ID
670649 YAML
671 )
672 echo "Inference geo: $(jq -r '.agent.model.inference_geo' <<< "$session")"
673650 ```
674651 
675652 ```python Python
Feedback