Class SessionCreateParams.Builder
-
- All Implemented Interfaces:
public final class SessionCreateParams.BuilderA builder for SessionCreateParams.
-
-
Method Summary
-
-
Method Detail
-
betas
final SessionCreateParams.Builder betas(List<AnthropicBeta> betas)
This endpoint is in beta: requests must send
managed-agents-2026-04-01in this header.
-
betas
final SessionCreateParams.Builder betas(Optional<List<AnthropicBeta>> betas)
Alias for calling Builder.betas with
betas.orElse(null).
-
workspaceId
final SessionCreateParams.Builder workspaceId(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.
-
workspaceId
final SessionCreateParams.Builder workspaceId(Optional<String> workspaceId)
Alias for calling Builder.workspaceId with
workspaceId.orElse(null).
-
body
final SessionCreateParams.Builder body(SessionCreateParams.Body body)
Sets the entire request body.
This is generally only useful if you are already constructing the body separately. Otherwise, it's more convenient to use the top-level setters instead:
-
additionalHeaders
final SessionCreateParams.Builder additionalHeaders(Headers additionalHeaders)
-
additionalHeaders
final SessionCreateParams.Builder additionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
additionalQueryParams
final SessionCreateParams.Builder additionalQueryParams(QueryParams additionalQueryParams)
-
additionalQueryParams
final SessionCreateParams.Builder additionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
addBeta
final SessionCreateParams.Builder addBeta(AnthropicBeta beta)
Adds a single AnthropicBeta to betas.
-
addBeta
final SessionCreateParams.Builder addBeta(String value)
Sets addBeta to an arbitrary String.
You should usually call addBeta with a well-typed AnthropicBeta constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
agent
final SessionCreateParams.Builder agent(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.
-
agent
final SessionCreateParams.Builder agent(JsonField<SessionCreateParams.Agent> agent)
Sets Builder.agent to an arbitrary JSON value.
You should usually call Builder.agent with a well-typed Agent value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
agent
final SessionCreateParams.Builder agent(String string)
Alias for calling agent with
Agent.ofString(string).
-
agent
final SessionCreateParams.Builder agent(BetaManagedAgentsAgentParams betaManagedAgentsAgentParams)
Alias for calling agent with
Agent.ofBetaManagedAgentsAgentParams(betaManagedAgentsAgentParams).
-
agent
final SessionCreateParams.Builder agent(BetaManagedAgentsAgentWithOverridesParams betaManagedAgentsAgentWithOverridesParams)
Alias for calling agent with
Agent.ofBetaManagedAgentsAgentWithOverridesParams(betaManagedAgentsAgentWithOverridesParams).
-
environmentId
final SessionCreateParams.Builder environmentId(String environmentId)
ID of the
environmentdefining the container configuration for this session.
-
environmentId
final SessionCreateParams.Builder environmentId(JsonField<String> environmentId)
Sets Builder.environmentId to an arbitrary JSON value.
You should usually call Builder.environmentId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
budget
final SessionCreateParams.Builder budget(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.
-
budget
final SessionCreateParams.Builder budget(JsonField<BetaManagedAgentsBudgetLimit> budget)
Sets Builder.budget to an arbitrary JSON value.
You should usually call Builder.budget with a well-typed BetaManagedAgentsBudgetLimit value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
limitBudget
final SessionCreateParams.Builder limitBudget(BetaMonetaryAmount maxListCost)
Alias for calling budget with the following:
BetaManagedAgentsBudgetLimit.builder() .maxListCost(maxListCost) .build()
-
initialEvents
final SessionCreateParams.Builder initialEvents(List<SessionCreateParams.InitialEvent> initialEvents)
Initial events to send to the
sessionat creation, processed in order. Supportsuser.messageanduser.define_outcomeevents. Maximum 50 events.
-
initialEvents
final SessionCreateParams.Builder initialEvents(JsonField<List<SessionCreateParams.InitialEvent>> initialEvents)
Sets Builder.initialEvents to an arbitrary JSON value.
You should usually call Builder.initialEvents with a well-typed
List<InitialEvent>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addInitialEvent
final SessionCreateParams.Builder addInitialEvent(SessionCreateParams.InitialEvent initialEvent)
Adds a single InitialEvent to initialEvents.
-
addInitialEvent
final SessionCreateParams.Builder addInitialEvent(BetaManagedAgentsUserMessageEventParams userMessage)
Alias for calling addInitialEvent with
InitialEvent.ofUserMessage(userMessage).
-
addInitialEvent
final SessionCreateParams.Builder addInitialEvent(BetaManagedAgentsUserDefineOutcomeEventParams userDefineOutcome)
Alias for calling addInitialEvent with
InitialEvent.ofUserDefineOutcome(userDefineOutcome).
-
addUserMessageInitialEvent
final SessionCreateParams.Builder addUserMessageInitialEvent(List<BetaManagedAgentsUserMessageEventParams.Content> content)
Alias for calling addInitialEvent with the following:
BetaManagedAgentsUserMessageEventParams.builder() .content(content) .build()
-
metadata
final SessionCreateParams.Builder metadata(SessionCreateParams.Metadata metadata)
Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
-
metadata
final SessionCreateParams.Builder metadata(JsonField<SessionCreateParams.Metadata> metadata)
Sets Builder.metadata to an arbitrary JSON value.
You should usually call Builder.metadata with a well-typed Metadata value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
resources
final SessionCreateParams.Builder resources(List<SessionCreateParams.Resource> resources)
Resources (e.g. repositories, files) to mount into the session's container.
-
resources
final SessionCreateParams.Builder resources(JsonField<List<SessionCreateParams.Resource>> resources)
Sets Builder.resources to an arbitrary JSON value.
You should usually call Builder.resources with a well-typed
List<Resource>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addResource
final SessionCreateParams.Builder addResource(SessionCreateParams.Resource resource)
-
addResource
final SessionCreateParams.Builder addResource(BetaManagedAgentsGitHubRepositoryResourceParams githubRepository)
Alias for calling addResource with
Resource.ofGitHubRepository(githubRepository).
-
addResource
final SessionCreateParams.Builder addResource(BetaManagedAgentsFileResourceParams file)
Alias for calling addResource with
Resource.ofFile(file).
-
addResource
final SessionCreateParams.Builder addResource(BetaManagedAgentsMemoryStoreResourceParam memoryStore)
Alias for calling addResource with
Resource.ofMemoryStore(memoryStore).
-
addGitHubRepositoryResource
final SessionCreateParams.Builder addGitHubRepositoryResource(String url)
Alias for calling addResource with the following:
BetaManagedAgentsGitHubRepositoryResourceParams.builder() .url(url) .build()
-
addFileResource
final SessionCreateParams.Builder addFileResource(String fileId)
Alias for calling addResource with the following:
BetaManagedAgentsFileResourceParams.builder() .fileId(fileId) .build()
-
addMemoryStoreResource
final SessionCreateParams.Builder addMemoryStoreResource(String memoryStoreId)
Alias for calling addResource with the following:
BetaManagedAgentsMemoryStoreResourceParam.builder() .memoryStoreId(memoryStoreId) .build()
-
title
final SessionCreateParams.Builder title(String title)
Human-readable session title.
-
title
final SessionCreateParams.Builder title(Optional<String> title)
Alias for calling Builder.title with
title.orElse(null).
-
title
final SessionCreateParams.Builder title(JsonField<String> title)
Sets Builder.title to an arbitrary JSON value.
You should usually call Builder.title with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
vaultIds
final SessionCreateParams.Builder vaultIds(List<String> vaultIds)
Vault IDs for stored credentials the agent can use during the session.
-
vaultIds
final SessionCreateParams.Builder vaultIds(JsonField<List<String>> vaultIds)
Sets Builder.vaultIds to an arbitrary JSON value.
You should usually call Builder.vaultIds with a well-typed
List<String>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addVaultId
final SessionCreateParams.Builder addVaultId(String vaultId)
-
additionalBodyProperties
final SessionCreateParams.Builder additionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
-
putAdditionalBodyProperty
final SessionCreateParams.Builder putAdditionalBodyProperty(String key, JsonValue value)
-
putAllAdditionalBodyProperties
final SessionCreateParams.Builder putAllAdditionalBodyProperties(Map<String, JsonValue> additionalBodyProperties)
-
removeAdditionalBodyProperty
final SessionCreateParams.Builder removeAdditionalBodyProperty(String key)
-
removeAllAdditionalBodyProperties
final SessionCreateParams.Builder removeAllAdditionalBodyProperties(Set<String> keys)
-
putAdditionalHeader
final SessionCreateParams.Builder putAdditionalHeader(String name, String value)
-
putAdditionalHeaders
final SessionCreateParams.Builder putAdditionalHeaders(String name, Iterable<String> values)
-
putAllAdditionalHeaders
final SessionCreateParams.Builder putAllAdditionalHeaders(Headers additionalHeaders)
-
putAllAdditionalHeaders
final SessionCreateParams.Builder putAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
replaceAdditionalHeaders
final SessionCreateParams.Builder replaceAdditionalHeaders(String name, String value)
-
replaceAdditionalHeaders
final SessionCreateParams.Builder replaceAdditionalHeaders(String name, Iterable<String> values)
-
replaceAllAdditionalHeaders
final SessionCreateParams.Builder replaceAllAdditionalHeaders(Headers additionalHeaders)
-
replaceAllAdditionalHeaders
final SessionCreateParams.Builder replaceAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
removeAdditionalHeaders
final SessionCreateParams.Builder removeAdditionalHeaders(String name)
-
removeAllAdditionalHeaders
final SessionCreateParams.Builder removeAllAdditionalHeaders(Set<String> names)
-
putAdditionalQueryParam
final SessionCreateParams.Builder putAdditionalQueryParam(String key, String value)
-
putAdditionalQueryParams
final SessionCreateParams.Builder putAdditionalQueryParams(String key, Iterable<String> values)
-
putAllAdditionalQueryParams
final SessionCreateParams.Builder putAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
putAllAdditionalQueryParams
final SessionCreateParams.Builder putAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
replaceAdditionalQueryParams
final SessionCreateParams.Builder replaceAdditionalQueryParams(String key, String value)
-
replaceAdditionalQueryParams
final SessionCreateParams.Builder replaceAdditionalQueryParams(String key, Iterable<String> values)
-
replaceAllAdditionalQueryParams
final SessionCreateParams.Builder replaceAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
replaceAllAdditionalQueryParams
final SessionCreateParams.Builder replaceAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
removeAdditionalQueryParams
final SessionCreateParams.Builder removeAdditionalQueryParams(String key)
-
removeAllAdditionalQueryParams
final SessionCreateParams.Builder removeAllAdditionalQueryParams(Set<String> keys)
-
build
final SessionCreateParams build()
Returns an immutable instance of SessionCreateParams.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.agent() .environmentId()
-
-
-
-