Skip to content
2DLABSBREAKTHROUGH AI, LABS & EDGE INFRASTRUCTURE

STATIC HTML DEVELOPER REFERENCE · ZERO JAVASCRIPT REQUIRED

2D Labs API Documentation & SDKs

Every product is directly testable from cURL, Python, JavaScript, or MCP using a single sg_live_... Bearer token on https://2dlabs.org/v1. No CAPTCHA, no browser lock-in, and complete OpenAPI 3.1.0 discovery.

1. Instant Headless Quickstart ($0 / 1,000 Units)

POST /v1/sandbox/quickstart
# Mint an instant live Bearer token without opening a browser:
TWODLABS_KEY=$(curl -sS -X POST https://2dlabs.org/v1/sandbox/quickstart \
  -H "Content-Type: application/json" \
  -d '{"label":"eval-run"}' | python3 -c "import sys,json; print(json.load(sys.stdin)['api_key'])")

# Call any of the 9 products immediately:
curl -sS -X POST https://2dlabs.org/v1/govern/truth \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"What is 15% of $240?","candidate":"15% of $240 is $42."}'

2. Python & JS Zero-Dep SDKs

STDLIB ONLY · ZERO PIP/NPM DEPS
# Download https://2dlabs.org/sdk/twodlabs.py
from twodlabs import TwoDLabsClient

client = TwoDLabsClient.from_sandbox("eval")
print(client.govern_truth(prompt="15% of $240?", candidate="$42"))
print(client.device_plan(workloads=[{"name":"qwen-3b","ram_mb":2150}]))
print(client.autonomy_sim(modality="quadrotor_uav"))
print(client.data_query("SELECT 0.1 + 0.2 = 0.3 AS exact;", prove=True))
print(client.dashboard_summary()["usage"])

3. Workspaces, Multi-Key Rotation & Dashboard Endpoints

SG_ACCT_ WORKSPACE TOKENS
POST /v1/accounts          # {email, organization?, label?} -> returns account_token (sg_acct_) + api_key (sg_live_)
GET  /v1/dashboard/summary # Consolidated plan, quota, 9-product breakdown, active keys & recent activity
GET  /v1/keys              # List active & revoked API keys for your workspace
POST /v1/keys              # Mint an additional scoped sg_live_ key
POST /v1/keys/revoke       # {key_id} -> immediately blocks revoked key with HTTP 401
GET  /v1/billing/usage     # Current monthly unit counts & per-product breakdown
GET  /v1/billing/activity  # Recent metered API call ledger
POST /v1/billing/checkout  # Start Pay-As-You-Go, Pro ($49) or Scale ($249) upgrade
POST /v1/receipts/verify   # {proof_token} -> verify cryptographic execution receipt
POST /mcp                  # HTTP MCP JSON-RPC 2.0 server exposing 22 tools across all 9 products

01 / SafeGate™ + SafeGrid™ (1 unit / call)

POST /v1/govern/truth · /v1/antidistill/inspect · /v1/govern/agent · /v1/govern/control_loop · /v1/grid/step · /v1/chat/completions

curl -sS -X POST https://2dlabs.org/v1/govern/truth \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"What is 15% of $240?","candidate":"15% of $240 is $42."}'

02 / PulseLock™ Calibration (2 units / call)

POST /v1/calibrate/analyze · POST /v1/calibrate/schedule

curl -sS -X POST https://2dlabs.org/v1/calibrate/analyze \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"device_profile":"superconducting_8q","ports":8,"rep_rate_mhz":100,"signal_trace":[0.98,0.87,0.64,0.35,0.06,-0.15]}'

03 / OmniSense™ Multi-Sensor Fusion (2 units / call)

POST /v1/omnisense/fuse

curl -sS -X POST https://2dlabs.org/v1/omnisense/fuse \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scenario":"substation_bay","nodes":[{"id":"pt_01","reading":84.2,"tolerance":0.8},{"id":"pt_02","reading":84.5,"tolerance":0.8},{"id":"pt_spoof","reading":61.0,"tolerance":0.8}]}'

04 / ProofVault™ ZK Equivalence & Confidence (3 units / call)

POST /v1/proofvault/attest · POST /v1/proofvault/calibrate

curl -sS -X POST https://2dlabs.org/v1/proofvault/attest \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"checkpoint_equivalence","reference_profile":{"moments":[2.1,1.54,1.18]},"candidate_profile":{"moments":[2.1,1.54,1.18]}}'

05 / SlimIQ™ Structural Model Surgery (1u compare / 10u surgery)

POST /v1/slim/surgery · POST /v1/slim/compare

curl -sS -X POST https://2dlabs.org/v1/slim/compare \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model_name":"7B Reasoning Instruct","params_b":7}'

06 / ApexTrain™ Elastic Training Studio (0u tiers/jobs · 1u estimate · 25u launch)

GET /v1/train/tiers · POST /v1/train/estimate · POST /v1/train/launch · GET /v1/train/jobs/{job_id}

curl -sS -X POST https://2dlabs.org/v1/train/estimate \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"base_model":"7B Reasoning Base","epochs":3,"tier_id":"pro-80g","dataset_tokens":4500000}'

07 / 2Device Edge Workload & Thermal Engine (1u thermal · 2u plan)

POST /v1/device/plan · POST /v1/device/thermal (also live on https://2device.org/v1/*)

curl -sS -X POST https://2dlabs.org/v1/device/plan \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"device":{"model":"iPhone16,2","ram_mb":8192,"total_cores":6,"has_gpu":true},"workloads":[{"name":"qwen-3b","ram_mb":2150,"priority":"high","gpu_intensity":0.85}]}'

08 / 2D AI Physical Autonomy Engine (1u session · 5u sim · 8u field/hal/multiweek)

POST /v1/autonomy/sim · /v1/autonomy/field · /v1/autonomy/hal · /v1/autonomy/multiweek · /v1/autonomy/sessions

curl -sS -X POST https://2dlabs.org/v1/autonomy/sim \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modality":"quadrotor_uav","preset":"urban_glass_and_pillars","instruction":"inspect targets and return home"}'

09 / 2data Exact SQL, Clearing & Spatial Engine (2u query · 5u prove/zoom · 8u compute · 10u clearing)

POST /v1/data/query · POST /v1/data/clearing/settle · GET /v1/data/clearing/ledger · POST /v1/data/zoom/* · POST /v1/data/compute

curl -sS -X POST https://2dlabs.org/v1/data/query \
  -H "Authorization: Bearer $TWODLABS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sql":"SELECT 0.1 + 0.2 = 0.3 AS exact_ok;","prove":true}'