Skip to main content

Bitbybit CAD Cloud API

Bitbybit CAD Cloud runs CAD work on our servers. You call it over plain HTTP from a backend, a nightly batch job or an AI agent, in any language. Each job runs as a task, and you download what it made: a STEP model, a glTF for the web, a DXF or SVG cut file, or a JSON report.

It offers two things:

  • Pro algorithms that run only here. Sheet-metal unfolding and true-shape nesting have no open-source counterpart, and drawing sheets turn a STEP model into views, sections and a title block on paper.
  • The open-source operations, run for you. The operations of the Bitbybit OCCT Kernel, JSCAD and Manifold, for work you would rather not host: a batch of thousands of parts, a quote your server must compute itself, or a serverless function that cannot load a kernel.

If the open-source operations are all you need and you can run them in your own browser or Node process, the npm packages do that for free.

More algorithms join this list with each release.

Send a STEP file of bent sheet-metal parts and get back the flat pattern of every solid in it, each bend measured, and, if you ask, the flats nested on sheets in the same call.

  • Every solid in the file is flattened in one call
  • Sheet thickness is found from the part, or set by you
  • The K-factor is yours to choose, 0.5 unless you say otherwise
  • Flats as STEP or glTF, nested sheets as DXF or SVG cut files
How sheet-metal unfolding works

What you can ask for​

You sendRouteYou get back
A STEP file of bent sheet-metal partsPOST /api/v1/cad/pro/unfold/...: six routes, for one face or every solid, as geometry, a report or both, and one that unfolds and nestsThe flat patterns as STEP, STPZ, glTF or a decomposed mesh, and a report of every bend as JSON. The unfold-and-nest route also nests the flats on sheets and gives the cut paths as DXF or SVG
STEP files of flat partsPOST /api/v1/cad/pro/nesting/nestThe cut paths as DXF or SVG, the outlines as JSON, the nested sheets as STEP, STPZ, glTF or a decomposed mesh, and a report of every placement
A STEP file of a part or an assemblyPOST /api/v1/cad/pro/drawing/drawDrawing sheets as PDF, DXF or SVG: views lined up at a standard scale, hidden lines, hatched sections and a title block, one sheet or a set, and a report of every sheet
A STEP filePOST /api/v1/convert/step-to-gltf, and three variants with advanced options, Draco compression, or bothA GLB file for the web
A pipeline: up to 50 steps, each able to use the results of the ones before itPOST /api/v1/cad/pipelineThe final shape as STEP, STPZ, glTF, STL, 3MF, BREP or a decomposed mesh, or the final value as JSON or CSV
A Designer documentA pipeline whose step is occt.design.buildThe parts as STEP and glTF, and the build's report
One operation, or up to 100 that run side by sidePOST /api/v1/cad/execute, POST /api/v1/cad/compoundWhat each operation returns
A registered model's parametersPOST /api/v1/models/{name}, for dragon-cup and phone-nestThe model as STEP, STPZ, glTF or a decomposed mesh

The Sheet-metal unfolding, Nesting and Drawing sheets pages explain each algorithm's options and outputs. The input templates are ready-made files to try them on. Every route, with its full request and response, is in the API reference.

How a job runs​

Every request that makes geometry is a task. A slow job never becomes a timed-out HTTP request: an unfold that takes two minutes is handled the same way as one that takes two seconds.

  1. Upload the files the job reads, if it reads any. POST /api/v1/files/upload gives you a fileId and an address to PUT the bytes to, and POST /api/v1/files/{fileId}/confirm finishes the upload.
  2. Send the job. It answers 202 Accepted with a taskId straight away.
  3. Poll GET /api/v1/tasks/{taskId}. The status goes from queued to processing, then ends as completed, failed or cancelled.
  4. Download. GET /api/v1/tasks/{taskId}/results lists every output, each with a download address that works for an hour. GET /api/v1/tasks/{taskId}/result/{format} gives you one of them.

The TypeScript SDK does the upload in one call (client.files.uploadBytes), and its ...AndPoll methods wait for the task for you. A task can be cancelled or retried, and Bitbybit Studio lists every task under Tasks.

Your API key​

Every call except GET /health carries your key in the X-API-Key header. To get a key:

  1. Create a free Bitbybit account, or sign in to the one you have.
  2. In Bitbybit Studio, open Billing and choose a plan: Starter, Professional or Business. Payment runs through Stripe's checkout.
  3. When the payment goes through, the Studio shows your key once. Copy it then. If you lose it, choose Regenerate Key on the Studio's Dashboard: you get a new key, and the old one stops working at once.

Every plan's key can call every route. Plans differ in how many compute minutes a month they include, how fast a server they run on, how many tasks run at once, the largest file you can upload, and whether you can go over your minutes. The Studio's Billing page compares them.

Keep the key on a server. A web page should call your backend, and your backend should call CAD Cloud, as the example apps do.

Your first call​

This script makes a box with rounded edges and saves it as STEP and glTF. Install the SDK and set your key:

npm install @bitbybit-dev/cad-cloud-sdk
export BITBYBIT_API_KEY=<your key>

Save the script as first-call.ts and run node first-call.ts. Node 22.18 or later runs TypeScript as it is.

first-call.ts
import { writeFileSync } from "node:fs";
import { BitbybitClient } from "@bitbybit-dev/cad-cloud-sdk";

const apiKey = process.env["BITBYBIT_API_KEY"];
if (!apiKey) throw new Error("Set BITBYBIT_API_KEY to your CAD Cloud API key");
const baseUrl = process.env["BITBYBIT_API_URL"];
const client = new BitbybitClient(baseUrl ? { apiKey, baseUrl } : { apiKey });