Skip to main content

Prerequisites

  • A running Oshu Vault instance (see deployment guide)
  • An API key for the proxy’s management API
  • A sandbox provider account (E2B or Daytona)

Install the SDK

npm install @oshu/vault-sdk @e2b/code-interpreter

Quickstart

First, build the custom template with the CA cert and Claude Code baked in.
1

Create a session with your secrets

import { Sandbox } from "@e2b/code-interpreter";
import { SecretsProxyClient } from "@oshu/vault-sdk";

const client = new SecretsProxyClient({
  baseUrl: "https://pv.oshu.dev",
  apiKey: process.env.SECRETS_PROXY_API_KEY!,
});

const session = await client.createSession({
  secrets: {
    ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY!,
  },
});
2

Create the sandbox from the template

const proxyUrl = `https://${session.session_id}:${session.token}@pv.oshu.dev`;

const sandbox = await Sandbox.create("oshu-vault-claude", {
  envs: {
    ANTHROPIC_API_KEY: session.sealed_secrets["ANTHROPIC_API_KEY"],
    HTTP_PROXY: proxyUrl,
    HTTPS_PROXY: proxyUrl,
  },
});
3

Run code — secrets are injected automatically

The template already has Claude Code installed and the CA cert trusted. Just run:
try {
  const result = await sandbox.commands.run(
    `claude -p "Write a hello world program in Python"`,
    { timeoutMs: 120_000 },
  );
  console.log(result.stdout);
} finally {
  await client.deleteSession(session.session_id);
  await sandbox.kill();
}

Next Steps

See the full integration examples for more details: