Session

September 16, 2026 ยท View on GitHub

This object contains information related to a Vercel Sandbox Session. v2 endpoints return "session" instead of "sandbox" as the response wrapper key.

Example Usage

import { Session } from "@vercel/sdk/models/session.js";

let value: Session = {
  abortedAt: 1750344501629,
  activeCpuDurationMs: 42,
  createdAt: 1750344501629,
  cwd: "/vercel/sandbox",
  duration: 3600000,
  id: "sbx_123a6c5209bc3778245d011443644c8d27dc2c50",
  memory: 2048,
  networkPolicy: {
    allowedCIDRs: [
      "10.0.0.0/8",
    ],
    allowedDomains: [
      "api.vercel.com",
      "*.example.com",
    ],
    deniedCIDRs: [
      "10.0.0.0/8",
    ],
    injectionRules: [
      {
        domain: "api.vercel.com",
        headerNames: [
          "Authorization",
          "X-API-Key",
        ],
      },
    ],
    mode: "custom",
  },
  networkTransfer: {
    egress: 4698.63,
    ingress: 6786.95,
  },
  projectId: "prj_123a6c5209bc3778245d011443644c8d27dc2c50",
  region: "iad1",
  requestedAt: 1750344501629,
  requestedStopAt: 1750344501629,
  runtime: "node22",
  snapshottedAt: 1750344501629,
  sourceSandboxName: "my-sandbox",
  sourceSnapshotId: "snap_123a6c5209bc3778245d011443644c8d27dc2c50",
  startedAt: 1750344501629,
  status: "running",
  stoppedAt: 1750344501629,
  timeout: 3600000,
  updatedAt: 1750344501629,
  vcpus: 2,
};

Fields

FieldTypeRequiredDescriptionExample
abortedAtnumber:heavy_minus_sign:The time when the sandbox was aborted, in milliseconds since the epoch.1750344501629
activeCpuDurationMsnumber:heavy_minus_sign:The amount of CPU time the sandbox consumed, if available, in milliseconds. This value is only available once the sandbox is stopped, and only if it stopped successfully.42
createdAtnumber:heavy_check_mark:The time when the sandbox was created, in milliseconds since the epoch.1750344501629
cwdstring:heavy_check_mark:The working directory of the sandbox./vercel/sandbox
durationnumber:heavy_minus_sign:The duration of the sandbox in milliseconds.3600000
idstring:heavy_check_mark:The unique identifier of the sandbox.sbx_123a6c5209bc3778245d011443644c8d27dc2c50
memorynumber:heavy_check_mark:Memory allocated to this sandbox in MB.2048
networkPolicymodels.SandboxNetworkPolicy:heavy_minus_sign:The network policy applied to this sandbox, if any.
networkTransfermodels.NetworkTransfer:heavy_minus_sign:The quantity of data transfered to and from the sandbox, in bytes. This value is only available once the sandbox is stopped, and only if it stopped successfully.{
"in": 12543852,
"out": 15368
}
projectIdstring:heavy_check_mark:The unique identifier of the project associated with this session.prj_123a6c5209bc3778245d011443644c8d27dc2c50
regionstring:heavy_check_mark:The region where the sandbox is hosted.iad1
requestedAtnumber:heavy_check_mark:The time when the sandbox was requested, in milliseconds since the epoch.1750344501629
requestedStopAtnumber:heavy_minus_sign:The time when the sandbox was requested to stop, in milliseconds since the epoch.1750344501629
runtimestring:heavy_check_mark:The runtime of the sandbox.node22
snapshottedAtnumber:heavy_minus_sign:The time when a snapshot was requested, in milliseconds since the epoch.1750344501629
sourceSandboxNamestring:heavy_check_mark:The name of the source sandbox.my-sandbox
sourceSnapshotIdstring:heavy_minus_sign:The unique identifier of the snapshot associated with this sandbox, if any.snap_123a6c5209bc3778245d011443644c8d27dc2c50
startedAtnumber:heavy_minus_sign:The time when the sandbox was started, in milliseconds since the epoch.1750344501629
statusmodels.SessionStatus:heavy_check_mark:The status of the sandbox.running
stoppedAtnumber:heavy_minus_sign:The time when the sandbox was stopped, in milliseconds since the epoch.1750344501629
timeoutnumber:heavy_check_mark:The maximum amount of time the sandbox will run for in milliseconds.3600000
updatedAtnumber:heavy_check_mark:The last time the sandbox was updated, in milliseconds since the epoch.1750344501629
vcpusnumber:heavy_check_mark:Number of vCPUs allocated to this sandbox.2