Class SessionCreateParams
-
- All Implemented Interfaces:
-
com.anthropic.core.Params
public final class SessionCreateParams implements Params
Create Session
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSessionCreateParams.BuilderA builder for SessionCreateParams.
public final classSessionCreateParams.BodyRequest parameters for creating a
session.public final classSessionCreateParams.AgentAgent identifier. Accepts the
agentID string, which pins the latest version for the session, or anagentobject with both id and version specified.public final classSessionCreateParams.InitialEventAn event sent to the
sessionimmediately after it is created. Supportsuser.messageanduser.define_outcome.public final classSessionCreateParams.MetadataArbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
public final classSessionCreateParams.ResourceUnion of resources that can be mounted into a session.
-
Method Summary
Modifier and Type Method Description final Optional<List<AnthropicBeta>>betas()This endpoint is in beta: requests must send managed-agents-2026-04-01in this header.final Optional<String>workspaceId()Optional header to select the Workspace for this request. final SessionCreateParams.Agentagent()Agent identifier. final StringenvironmentId()ID of the environmentdefining the container configuration for this session.final Optional<BetaManagedAgentsBudgetLimit>budget()Enforced spend ceiling for the session. final Optional<List<SessionCreateParams.InitialEvent>>initialEvents()Initial events to send to the sessionat creation, processed in order.final Optional<SessionCreateParams.Metadata>metadata()Arbitrary key-value metadata attached to the session. final Optional<List<SessionCreateParams.Resource>>resources()Resources (e.g. final Optional<String>title()Human-readable session title. final Optional<List<String>>vaultIds()Vault IDs for stored credentials the agent can use during the session. final JsonField<SessionCreateParams.Agent>_agent()Returns the raw JSON value of agent. final JsonField<String>_environmentId()Returns the raw JSON value of environmentId. final JsonField<BetaManagedAgentsBudgetLimit>_budget()Returns the raw JSON value of budget. final JsonField<List<SessionCreateParams.InitialEvent>>_initialEvents()Returns the raw JSON value of initialEvents. final JsonField<SessionCreateParams.Metadata>_metadata()Returns the raw JSON value of metadata. final JsonField<List<SessionCreateParams.Resource>>_resources()Returns the raw JSON value of resources. final JsonField<String>_title()Returns the raw JSON value of title. final JsonField<List<String>>_vaultIds()Returns the raw JSON value of vaultIds. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final SessionCreateParams.BuildertoBuilder()final SessionCreateParams.Body_body()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. SpanData_spanData()The data for the OpenTelemetry span of a call to the method with these parameters. Booleanequals(Object other)IntegerhashCode()StringtoString()final static SessionCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of SessionCreateParams. -
-
Method Detail
-
betas
final Optional<List<AnthropicBeta>> betas()
This endpoint is in beta: requests must send
managed-agents-2026-04-01in this header.
-
workspaceId
final Optional<String> workspaceId()
Optional header to select the Workspace for this request. The value is a Workspace ID (for example,
wrkspc_011CZkZaBF1tNoB5wlCeusgy).Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
-
agent
final SessionCreateParams.Agent agent()
Agent identifier. Accepts the
agentID string, which pins the latest version for the session, or anagentobject with both id and version specified.
-
environmentId
final String environmentId()
ID of the
environmentdefining the container configuration for this session.
-
budget
final Optional<BetaManagedAgentsBudgetLimit> budget()
Enforced spend ceiling for the session. Omit to create an uncapped session. Every model the session can run — the agent's model and each callable agent's model — must have a public list price, or the request is rejected with reason
model_not_budgetable.
-
initialEvents
final Optional<List<SessionCreateParams.InitialEvent>> initialEvents()
Initial events to send to the
sessionat creation, processed in order. Supportsuser.messageanduser.define_outcomeevents. Maximum 50 events.
-
metadata
final Optional<SessionCreateParams.Metadata> metadata()
Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
-
resources
final Optional<List<SessionCreateParams.Resource>> resources()
Resources (e.g. repositories, files) to mount into the session's container.
-
vaultIds
final Optional<List<String>> vaultIds()
Vault IDs for stored credentials the agent can use during the session.
-
_agent
final JsonField<SessionCreateParams.Agent> _agent()
Returns the raw JSON value of agent.
Unlike agent, this method doesn't throw if the JSON field has an unexpected type.
-
_environmentId
final JsonField<String> _environmentId()
Returns the raw JSON value of environmentId.
Unlike environmentId, this method doesn't throw if the JSON field has an unexpected type.
-
_budget
final JsonField<BetaManagedAgentsBudgetLimit> _budget()
Returns the raw JSON value of budget.
Unlike budget, this method doesn't throw if the JSON field has an unexpected type.
-
_initialEvents
final JsonField<List<SessionCreateParams.InitialEvent>> _initialEvents()
Returns the raw JSON value of initialEvents.
Unlike initialEvents, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<SessionCreateParams.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_resources
final JsonField<List<SessionCreateParams.Resource>> _resources()
Returns the raw JSON value of resources.
Unlike resources, this method doesn't throw if the JSON field has an unexpected type.
-
_title
final JsonField<String> _title()
Returns the raw JSON value of title.
Unlike title, this method doesn't throw if the JSON field has an unexpected type.
-
_vaultIds
final JsonField<List<String>> _vaultIds()
Returns the raw JSON value of vaultIds.
Unlike vaultIds, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final SessionCreateParams.Builder toBuilder()
-
_body
final SessionCreateParams.Body _body()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
_spanData
SpanData _spanData()
The data for the OpenTelemetry span of a call to the method with these parameters.
-
builder
final static SessionCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of SessionCreateParams.
The following fields are required:
.agent() .environmentId()
-
-
-
-