Skip to main content

Bitbybit CAD Cloud API

The Bitbybit CAD Cloud API lets you generate parametric 3D CAD models, convert STEP files to glTF, and run OCCT kernel operations — all via HTTP from any backend, in any programming language.

Every request runs asynchronously on managed compute infrastructure powered by Bitbybit servers. You submit a job, get a task ID, poll for completion, and download the result in the format you need (STEP, glTF/GLB, Decomposed Mesh, and more).

What you can do

  • Generate parametric models — submit parameters for registered models (e.g. Dragon Cup, Phone Nest) and get downloadable 3D files
  • Convert STEP → glTF — upload a STEP/STP file and convert it with simple or advanced options (mesh precision, face merging, coordinate adjustment, texture embedding, and more)
  • Run CAD pipelines — chain OCCT operations (primitives, booleans, transforms, fillets) in a single request where steps can reference each other's outputs
  • Execute single CAD operations — run any OCCT operation by its dotted path (e.g. occt.shapes.solid.createSphere)
  • Manage tasks — poll status, cancel, retry, list, and download results in multiple formats
  • Upload files — upload STEP files for conversion via pre-signed URLs

Key components

API server

The REST API at https://api.bitbybit.dev. All endpoints require an API key passed via the x-api-key header. See the full API Reference for endpoint details, request/response schemas, and examples.

Studio

Bitbybit Studio is a browser-based dashboard where you can use all of the API's features through a visual interface — generate models, convert files, build pipelines, inspect tasks, and preview 3D results. Everything you do in Studio maps directly to an API call, so it's a great way to experiment before writing code. Read more in the Studio introduction.

TypeScript SDK

The @bitbybit-dev/cad-cloud-api npm package provides a type-safe client for Node.js and edge runtimes. It handles request construction, error mapping, and includes a built-in polling helper.

npm install @bitbybit-dev/cad-cloud-api

Getting an API key

  1. Create an account at bitbybit.dev/auth/sign-up
  2. Subscribe to an API key plan in Studio — plans include a compute-minute allowance for running CAD operations
  3. Create a scoped API key from your Studio dashboard — keys are scoped to specific capabilities (models, tasks, cad, convert, files)

Calling the API from any language

The API is a standard REST API, which means you can call it from any language that supports HTTP requests. Here's a minimal example using curl:

# Generate a Dragon Cup model
curl -X POST https://api.bitbybit.dev/api/v1/models/dragon-cup \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"params": { "height": 10, "radiusBottom": 5 },
"outputs": { "formats": ["gltf"] }
}'

# Response: { "ok": true, "data": { "taskId": "...", "status": "queued", "statusUrl": "..." } }

# Poll the task
curl https://api.bitbybit.dev/api/v1/tasks/TASK_ID \
-H "x-api-key: YOUR_API_KEY"

# Download result when completed
curl https://api.bitbybit.dev/api/v1/tasks/TASK_ID/result/glb \
-H "x-api-key: YOUR_API_KEY"

Using the TypeScript SDK

Initialize the client

import { BitbybitClient } from "@bitbybit-dev/cad-cloud-api";

const client = new BitbybitClient({
apiKey: process.env.BITBYBIT_API_KEY,
baseUrl: "https://api.bitbybit.dev",
});

Generate a parametric model

The models.run() method submits a model generation request, polls for completion, and returns the download URL in a single call:

const { taskId, downloadUrl } = await client.models.run("dragon-cup", {
params: {
height: 8,
radiusBottom: 4,
radiusTopOffset: 2,
thickness: 0.6,
scale: 1,
},
outputs: {
formats: ["gltf"],
},
});

console.log("Download:", downloadUrl);

Run a CAD pipeline

Chain multiple OCCT operations — each step can reference previous steps' outputs using $ref:N:

const created = await client.cad.pipeline({
steps: [
{
operation: "occt.shapes.solid.createSphere",
params: { radius: 5, center: [0, 0, 0] },
},
{
operation: "occt.shapes.solid.createBox",
params: { width: 6, length: 6, height: 6, center: [3, 0, 0] },
},
{
operation: "occt.booleans.difference",
params: {
shape: "$ref:0",
shapes: ["$ref:1"],
keepEdges: false,
},
},
],
});

// Poll until completion
const task = await client.tasks.poll(created.taskId, {
onProgress: (t) => console.log(`Status: ${t.status}`),
});

// Download the result
const result = await client.tasks.getResult(task.taskId);
console.log("Download:", result.downloadUrl);

Execute a single CAD operation

const created = await client.cad.execute({
operation: "occt.shapes.solid.createSphere",
params: { radius: 3, center: [0, 0, 0] },
});

const task = await client.tasks.poll(created.taskId);
const result = await client.tasks.getResult(task.taskId);
console.log("Download:", result.downloadUrl);

Use in an Express server

import express from "express";
import { BitbybitClient } from "@bitbybit-dev/cad-cloud-api";

const app = express();
app.use(express.json());

const client = new BitbybitClient({
apiKey: process.env.BITBYBIT_API_KEY,
baseUrl: "https://api.bitbybit.dev",
});

app.post("/api/generate", async (_req, res) => {
try {
const result = await client.models.run("dragon-cup", {
params: { height: 8, radiusBottom: 4 },
outputs: { formats: ["gltf"] },
});
res.json(result);
} catch (e) {
const message = e instanceof Error ? e.message : "Unknown error";
res.status(500).json({ error: message });
}
});

app.get("/api/task/:id", async (req, res) => {
try {
const task = await client.tasks.get(req.params.id);

if (task.status !== "completed") {
return res.json({ status: task.status });
}

const result = await client.tasks.getResult(task.taskId, "glb");
res.json({ status: "completed", downloadUrl: result.downloadUrl });
} catch (e) {
const message = e instanceof Error ? e.message : "Unknown error";
res.status(500).json({ error: message });
}
});

app.listen(3000);

Code examples

Full working examples are available in the open-source GitHub repo:

Each example includes a complete server with API routes and a browser frontend for testing.

Next steps