Skip to main content
Your code starts a Daytona sandbox and makes a OneCLI agent for it, on one vault. The sandbox can reach only OneCLI. Its HTTPS calls go through the gateway, which adds the vault’s key on the way out, so no key is ever in the sandbox.
On Daytona’s Tier 1 and Tier 2, the organization’s network limits apply to every sandbox and a sandbox cannot change them: only Daytona’s essential services stay reachable, and onecli.sh is not one of them (December 2026). Use Tier 3 or Tier 4.

Before you start

  • A OneCLI managing key in ONECLI_API_KEY. Make one in the dashboard under Settings > API keys. It stays with your code: never put it in the sandbox.
  • A Daytona API key in DAYTONA_API_KEY, from your Daytona dashboard.
  • Node.js 22 or later, or Python 3.11 or later.
  • The example uses your Personal vault and its Test key for httpbin.org, which every account starts with. Use any vault, and any host it has an item for.

Install

Example

Save the TypeScript as sandbox.mts and run npx tsx sandbox.mts, or the Python as sandbox.py and run python sandbox.py. It prints 200.

What goes where

The Sandboxes overview explains each value.

Good to know

  • The v0 client. In @daytona/sdk 2, sandboxes are made with daytona.v0.create, as in Daytona’s own docs. The Python daytona package 2 has the same v0 client, which needs the v0-sdk extra: the install line adds it.
  • An allow list is strict. With a domain allow list set, the sandbox reaches only those hosts. Add package registries such as registry.npmjs.org or pypi.org if the agent installs packages.
  • Node clients. Behind an allow list, Node’s http and https modules and axios fail, because they send no host name to the gateway. Give them agent.baseUrl(host) instead, or agent.base_url(host) in Python. See the SDK reference for TypeScript or Python.
  • Daytona’s own key injection. Daytona can also add a key to a sandbox’s calls itself, with secrets that the sandbox sees only as placeholders. See how OneCLI compares.

From a terminal

To connect one Daytona sandbox that is already running, make a connect token as in From a terminal, then run its install_command in the sandbox, as it is, in place of <install_command>:

Versions

Written in December 2026 for @onecli-sh/sdk 4.1 and @daytona/sdk 2.7 in TypeScript, and for onecli-sdk 0.1 and daytona 2.8 in Python.

Next steps