Skip to content

Install and authenticate

SDK Package Runtime
Python svm Python 3.10 or newer
TypeScript @svm/sandbox Node.js 18 or newer
Go github.com/jupimartofficial-cell/icloud/firecracker-agent-platform/sdk/go Go 1.27 or newer
Ruby svm (module SVM) Ruby 2.6 or newer
Java dev.svm:sandbox Java 11 or newer

All five are at version 0.2.0 and share one method surface. A method has the same meaning everywhere, written in each language’s own style: run_code in Python and Ruby, runCode in TypeScript and Java, RunCode in Go.

Terminal window
pip install ./sdk/python # add [cli] for the svm command: pip install './sdk/python[cli]'
  1. Create an API key in the SVM console under API keys. The key is shown once.

  2. Put the key and your API domain in the environment. Every SDK and the CLI read them:

    Terminal window
    export SVM_API_KEY='…' # never commit it, never pass it into a sandbox
    export SVM_DOMAIN='api.example.com'

    Or save them once with the CLI. The key is read without echo, and the file is written with mode 0600:

    Terminal window
    svm --domain api.example.com auth configure
  3. Create a client. With nothing passed, the SDK uses the environment, then the config file. Pass credentials explicitly when your application keeps them elsewhere:

    import os
    from svm import Sandbox, SandboxClient
    client = SandboxClient(
    domain=os.environ["SVM_DOMAIN"],
    api_key=os.environ["SVM_API_KEY"],
    )
    with Sandbox.create(template="base", client=client) as sandbox:
    print(sandbox.id, sandbox.state)

The SDKs check arguments first, then the environment, then the config file. The first source that holds a credential decides it. The domain is resolved the same way, on its own.

Setting Argument Environment
Domain domain SVM_DOMAIN
API key api_key SVM_API_KEY
Bearer session token bearer_token SVM_ACCESS_TOKEN

The config file is JSON ({"domain": "...", "api_key": "..."}). It is read from $SVM_CONFIG, or else from ~/.config/fcap/config.json. A file that holds a key must not be readable by others (chmod 600); the SDK refuses it otherwise.

Each SDK retries the same way:

  • Connection failures, and 502, 503 and 504 responses, are retried with jittered backoff: six attempts in all.
  • A 429 RATE_LIMITED response is retried after the wait the server asks for.
  • A POST is sent with an idempotency key, so a retried create never creates twice.
  • Other 4xx responses are not retried.

Each attempt times out after 10 seconds unless you set another limit.

The full list of errors you can catch is in Errors and retries.