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
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
abortedAt | number | :heavy_minus_sign: | The time when the sandbox was aborted, in milliseconds since the epoch. | 1750344501629 |
activeCpuDurationMs | number | :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 |
createdAt | number | :heavy_check_mark: | The time when the sandbox was created, in milliseconds since the epoch. | 1750344501629 |
cwd | string | :heavy_check_mark: | The working directory of the sandbox. | /vercel/sandbox |
duration | number | :heavy_minus_sign: | The duration of the sandbox in milliseconds. | 3600000 |
id | string | :heavy_check_mark: | The unique identifier of the sandbox. | sbx_123a6c5209bc3778245d011443644c8d27dc2c50 |
memory | number | :heavy_check_mark: | Memory allocated to this sandbox in MB. | 2048 |
networkPolicy | models.SandboxNetworkPolicy | :heavy_minus_sign: | The network policy applied to this sandbox, if any. | |
networkTransfer | models.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 } |
projectId | string | :heavy_check_mark: | The unique identifier of the project associated with this session. | prj_123a6c5209bc3778245d011443644c8d27dc2c50 |
region | string | :heavy_check_mark: | The region where the sandbox is hosted. | iad1 |
requestedAt | number | :heavy_check_mark: | The time when the sandbox was requested, in milliseconds since the epoch. | 1750344501629 |
requestedStopAt | number | :heavy_minus_sign: | The time when the sandbox was requested to stop, in milliseconds since the epoch. | 1750344501629 |
runtime | string | :heavy_check_mark: | The runtime of the sandbox. | node22 |
snapshottedAt | number | :heavy_minus_sign: | The time when a snapshot was requested, in milliseconds since the epoch. | 1750344501629 |
sourceSandboxName | string | :heavy_check_mark: | The name of the source sandbox. | my-sandbox |
sourceSnapshotId | string | :heavy_minus_sign: | The unique identifier of the snapshot associated with this sandbox, if any. | snap_123a6c5209bc3778245d011443644c8d27dc2c50 |
startedAt | number | :heavy_minus_sign: | The time when the sandbox was started, in milliseconds since the epoch. | 1750344501629 |
status | models.SessionStatus | :heavy_check_mark: | The status of the sandbox. | running |
stoppedAt | number | :heavy_minus_sign: | The time when the sandbox was stopped, in milliseconds since the epoch. | 1750344501629 |
timeout | number | :heavy_check_mark: | The maximum amount of time the sandbox will run for in milliseconds. | 3600000 |
updatedAt | number | :heavy_check_mark: | The last time the sandbox was updated, in milliseconds since the epoch. | 1750344501629 |
vcpus | number | :heavy_check_mark: | Number of vCPUs allocated to this sandbox. | 2 |