BetaAgentsOperations interface

Interface representing a BetaAgents operations.

Properties

createSession

Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from version_indicator and enforces session ownership using the provided isolation key for session-mutating operations.

deleteSession

Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist.

deleteSessionFile

Delete a file or directory from the session sandbox. If recursive is false (default) and the target is a non-empty directory, the API returns 409 Conflict.

downloadSessionFile

Download a file from the session sandbox as a binary stream.

getSession

Retrieves a session by ID.

listSessionFiles

List files and directories at a given path in the session sandbox. Returns only the immediate children of the specified directory (non-recursive).

listSessions

Returns a list of sessions for the specified agent.

patchAgent

Updates an agent endpoint.

uploadSessionFile

Upload a file to the session sandbox via binary stream. Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large.

Property Details

createSession

Creates a new session for an agent endpoint. The endpoint resolves the backing agent version from version_indicator and enforces session ownership using the provided isolation key for session-mutating operations.

createSession: (agentName: string, isolationKey: string, versionIndicator: VersionIndicatorUnion, options?: BetaAgentsCreateSessionOptionalParams) => Promise<AgentSessionResource>

Property Value

(agentName: string, isolationKey: string, versionIndicator: VersionIndicatorUnion, options?: BetaAgentsCreateSessionOptionalParams) => Promise<AgentSessionResource>

deleteSession

Deletes a session synchronously. Returns 204 No Content when the session is deleted or does not exist.

deleteSession: (agentName: string, sessionId: string, isolationKey: string, options?: BetaAgentsDeleteSessionOptionalParams) => Promise<void>

Property Value

(agentName: string, sessionId: string, isolationKey: string, options?: BetaAgentsDeleteSessionOptionalParams) => Promise<void>

deleteSessionFile

Delete a file or directory from the session sandbox. If recursive is false (default) and the target is a non-empty directory, the API returns 409 Conflict.

deleteSessionFile: (agentName: string, sessionId: string, path: string, options?: BetaAgentsDeleteSessionFileOptionalParams) => Promise<void>

Property Value

(agentName: string, sessionId: string, path: string, options?: BetaAgentsDeleteSessionFileOptionalParams) => Promise<void>

downloadSessionFile

Download a file from the session sandbox as a binary stream.

downloadSessionFile: (agentName: string, sessionId: string, path: string, options?: BetaAgentsDownloadSessionFileOptionalParams) => Promise<BetaAgentsDownloadSessionFileResponse>

Property Value

(agentName: string, sessionId: string, path: string, options?: BetaAgentsDownloadSessionFileOptionalParams) => Promise<BetaAgentsDownloadSessionFileResponse>

getSession

Retrieves a session by ID.

getSession: (agentName: string, sessionId: string, options?: BetaAgentsGetSessionOptionalParams) => Promise<AgentSessionResource>

Property Value

(agentName: string, sessionId: string, options?: BetaAgentsGetSessionOptionalParams) => Promise<AgentSessionResource>

listSessionFiles

List files and directories at a given path in the session sandbox. Returns only the immediate children of the specified directory (non-recursive).

listSessionFiles: (agentName: string, sessionId: string, path: string, options?: BetaAgentsListSessionFilesOptionalParams) => Promise<SessionDirectoryListResponse>

Property Value

(agentName: string, sessionId: string, path: string, options?: BetaAgentsListSessionFilesOptionalParams) => Promise<SessionDirectoryListResponse>

listSessions

Returns a list of sessions for the specified agent.

listSessions: (agentName: string, options?: BetaAgentsListSessionsOptionalParams) => PagedAsyncIterableIterator<AgentSessionResource, AgentSessionResource[], PageSettings>

Property Value

(agentName: string, options?: BetaAgentsListSessionsOptionalParams) => PagedAsyncIterableIterator<AgentSessionResource, AgentSessionResource[], PageSettings>

patchAgent

Updates an agent endpoint.

patchAgent: (agentName: string, options?: BetaAgentsPatchAgentObjectOptionalParams) => Promise<Agent>

Property Value

(agentName: string, options?: BetaAgentsPatchAgentObjectOptionalParams) => Promise<Agent>

uploadSessionFile

Upload a file to the session sandbox via binary stream. Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large.

uploadSessionFile: (agentName: string, sessionId: string, path: string, content: Uint8Array, options?: BetaAgentsUploadSessionFileOptionalParams) => Promise<SessionFileWriteResponse>

Property Value

(agentName: string, sessionId: string, path: string, content: Uint8Array, options?: BetaAgentsUploadSessionFileOptionalParams) => Promise<SessionFileWriteResponse>