Skip to main content
PRE-RELEASE: Sandbox commands are not GA yet. Their arguments, flags, and output may change.
Tokens grant access to a private preview until they expire. Append one to the preview URL as ?preview_token=<token>; the first request sets a cookie so a browser can keep navigating without it.

create

Creates a token granting access to a private preview until --expires-at.

Options

TEXT
required
Time the token stops working. ISO 8601, local when no timezone is given.
BOOL
Return an existing unexpired token of the preview that stays valid at least until —expires-at, instead of creating one. A token created moments before may not be found yet, so a new one may be created anyway.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
required
Name of the preview.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
BOOL
Enable verbose logging

Examples

Create a token valid until a given time

Filter output with --jq

Create a token and print it

Output

Text mode (--output text): One field per line describing the token, then the preview URL with the token appended. JSON mode (--output json): payload type managementapi.SandboxPreviewToken.

list

Lists a private preview’s tokens, including expired ones until they are removed. A public preview has no tokens.

Options

TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
required
Name of the preview.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
BOOL
Enable verbose logging

Examples

List a preview’s tokens

Filter output with --jq

Print every unexpired token’s name

Output

Text mode (--output text): Table with columns: NAME, EXPIRES, EXPIRED. Prints “No tokens found.” to stderr when the list is empty. JSON mode (--output json): payload type cmd.SandboxPreviewTokenList.

delete

Revokes a token. Requests using it are rejected at once.

Options

TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
required
Name of the sandbox.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
required
Name of the preview.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID the sandbox belongs to. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
TEXT
required
Name of the token.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Delete a token without the confirmation prompt

Output

Text mode (--output text): A confirmation line on stderr.