API

Convert, repair and print-prep 3D files from your own code.

Base URL: https://convertmesh-production.up.railway.app

Auth: send your Pro key in the X-Api-Key header. Without a key, requests use the free limits (20MB files, 3-file batches, 30 requests/minute per IP). Get a key.

Errors: non-2xx responses are JSON with error and error_code, e.g. file_too_large, premium_format_required, rate_limit_exceeded, conversion_timeout.

Quick start: AI model to print-ready STL

curl

curl -X POST https://convertmesh-production.up.railway.app/convert \
  -H "X-Api-Key: $CONVERTMESH_KEY" \
  -F "file=@model.glb" \
  -F "target=stl" \
  -F "repair=true" \
  -F "target_height_mm=80" \
  -o model.stl

Python

import os
import requests

with open("model.glb", "rb") as f:
    response = requests.post(
        "https://convertmesh-production.up.railway.app/convert",
        headers={"X-Api-Key": os.environ["CONVERTMESH_KEY"]},
        files={"file": ("model.glb", f)},
        data={"target": "stl", "repair": "true", "target_height_mm": "80"},
        timeout=120,
    )
response.raise_for_status()  # error details are JSON: response.json()["error"]
with open("model.stl", "wb") as out:
    out.write(response.content)

Node.js

// Node 18+ (built-in fetch, FormData and Blob)
import { readFile, writeFile } from "node:fs/promises";

const form = new FormData();
form.append("file", new Blob([await readFile("model.glb")]), "model.glb");
form.append("target", "stl");
form.append("repair", "true");
form.append("target_height_mm", "80");

const res = await fetch("https://convertmesh-production.up.railway.app/convert", {
  method: "POST",
  headers: { "X-Api-Key": process.env.CONVERTMESH_KEY },
  body: form,
});
if (!res.ok) throw new Error((await res.json()).error);
await writeFile("model.stl", Buffer.from(await res.arrayBuffer()));

Endpoints

EndpointBody (multipart)Returns
POST /convertfile, target, options belowThe converted file
POST /convert-manyfiles (repeat the field), target, optionsZIP of converted files
POST /convert-batcharchive (a ZIP), target, optionsZIP of converted files
GET /plannoneYour plan and limits (JSON)
GET /supportednoneInput and output formats for your plan (JSON)

Options

  • target: Output format: stl, obj, ply, glb, gltf, 3mf, step (Pro)
  • repair: true to close holes, fix normals and remove stray fragments
  • optimize_target_faces: Reduce to this many triangles (quadric decimation)
  • target_height_mm: Scale uniformly so the model is this tall
  • flatten_base_mm: Cut this much off the bottom and cap it (flat base)
  • place_on_bed: true to centre on X/Y and rest on Z = 0

Inputs: STL, OBJ, PLY, glTF (embedded buffers), GLB, 3MF, STEP/STP. Conversions time out after 90 seconds; reduce very large meshes first.