Quickstart Guide

Secrooq Compute provides secure, hardware-isolated Linux MicroVMs (powered by Firecracker) designed for executing arbitrary agent computations, AI workflows, and antidetect browsing environments.

โšก
Complimentary Tier: All new developer accounts receive 360,000 active compute seconds ($100 equivalent credit) automatically upon signup. No credit card required.

1. Generate API Keys

Log in to your Secrooq Compute Dashboard, navigate to the Settings tab, and click Create New API Key. Securely store your JWT token; it represents your root tenant credential.

2. Fire Up a Sandbox

Deploy your first isolated microVM in a single curl call. The instance initializes in less than 150ms.

Bash / Curl
curl -X POST https://secrooq-api.secrooq.workers.dev/sandboxes \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "autonomous-agent-01",
    "type": "ai_agent",
    "instance_type": "standard-1",
    "image": "ubuntu:22.04"
  }'

Authentication

All Central API requests must specify your secret tenant JSON Web Token (JWT) in the standard HTTP Authorization header using the Bearer schema.

HTTP Header
Authorization: Bearer secrooq-super-secret-jwt-key...

Central API Reference

Interact directly with the Cloudflare Central API. Base URL is: https://secrooq-api.secrooq.workers.dev

POST
/sandboxes

Creates and provisions an hardware-isolated Sandbox.

Request Body

Field Type Required Description
name string Yes Display name of the sandbox.
type string No Type of workspace. Default: ai_agent. Options: ai_agent, antidetect_browser.
instance_type string No Hardware class. Options: lite, basic, standard-1, standard-2.
image string No OS image. Default: ubuntu:22.04.

Execute Command

POST
/sandboxes/:id/exec

Executes a terminal shell command securely inside the microVM environment and streams standard output/error.

Request Body

Field Type Required Description
command string Yes The shell command sequence to run (e.g. python3 -c "print('hello')").
Bash / Curl Example
curl -X POST https://secrooq-api.secrooq.workers.dev/sandboxes/sb_a1b2c3d4/exec \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"command": "uname -a"}'

JavaScript / Node.js SDK Wrapper

Integrate Secrooq Sandbox seamlessly into Node.js applications using our standard asynchronous client wrapper.

JavaScript SDK (SecrooqCompute.js)
class SecrooqCompute {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseUrl = "https://secrooq-api.secrooq.workers.dev";
  }

  async request(path, options = {}) {
    const response = await fetch(`${this.baseUrl}${path}`, {
      ...options,
      headers: {
        "Authorization": `Bearer ${this.apiKey}`,
        "Content-Type": "application/json",
        ...options.headers
      }
    });
    return response.json();
  }

  // Provision microVM
  async createSandbox(name, options = {}) {
    return this.request("/sandboxes", {
      method: "POST",
      body: JSON.stringify({ name, ...options })
    });
  }

  // Execute terminal command
  async executeCommand(sandboxId, command) {
    return this.request(`/sandboxes/${sandboxId}/exec`, {
      method: "POST",
      body: JSON.stringify({ command })
    });
  }

  // Destroy sandbox instance
  async destroySandbox(sandboxId) {
    return this.request(`/sandboxes/${sandboxId}`, {
      method: "DELETE"
    });
  }
}

// Client usage
(async () => {
  const secrooq = new SecrooqCompute("YOUR_JWT_TOKEN");
  
  console.log("๐Ÿš€ Provisioning microVM...");
  const vm = await secrooq.createSandbox("js-sdk-example");
  console.log("Created!", vm);

  if (vm.id) {
    console.log("๐Ÿƒ Executing node scripts...");
    const res = await secrooq.executeCommand(vm.id, "node -v");
    console.log("Output:", res.output);

    console.log("๐Ÿงน Destroying sandbox...");
    await secrooq.destroySandbox(vm.id);
    console.log("VM cleaned up.");
  }
})();

Python SDK Wrapper

Run autonomous agent loops with multi-sandbox environments using our optimized Python client wrapper.

Python SDK (secrooq_compute.py)
import urllib.request
import json

class SecrooqCompute:
    def __init__(self, api_key: str):
        self.api_key = api_key
        self.base_url = "https://secrooq-api.secrooq.workers.dev"

    def _request(self, path: str, method: str = "GET", data: dict = None):
        url = f"{self.base_url}{path}"
        req = urllib.request.Request(url, method=method)
        req.add_header("Authorization", f"Bearer {self.api_key}")
        req.add_header("Content-Type", "application/json")
        
        payload = json.dumps(data).encode("utf-8") if data else None
        try:
            with urllib.request.urlopen(req, data=payload) as response:
                return json.loads(response.read().decode("utf-8"))
        except urllib.error.HTTPError as e:
            return json.loads(e.read().decode("utf-8"))

    def create_sandbox(self, name: str, instance_type: str = "standard-1"):
        return self._request("/sandboxes", "POST", {"name": name, "instance_type": instance_type})

    def execute_command(self, sandbox_id: str, command: str):
        return self._request(f"/sandboxes/{sandbox_id}/exec", "POST", {"command": command})

    def destroy_sandbox(self, sandbox_id: str):
        return self._request(f"/sandboxes/{sandbox_id}", "DELETE")

# Usage Example
if __name__ == "__main__":
    secrooq = SecrooqCompute("YOUR_JWT_TOKEN")
    
    print("๐Ÿš€ Spawning agent sandbox in Python...")
    vm = secrooq.create_sandbox("python-agent-01")
    print("Sandbox details:", vm)
    
    if "id" in vm:
        sandbox_id = vm["id"]
        print(f"๐Ÿƒ Running telemetry checks on sandbox {sandbox_id}...")
        res = secrooq.execute_command(sandbox_id, "python3 --version")
        print("Output:", res.get("output", ""))
        
        print("๐Ÿงน Cleaning environment...")
        secrooq.destroy_sandbox(sandbox_id)
        print("Sandbox destroyed.")