DOCS // SPATIAL.COMPILER

REST API

Send a POST to https://api.spatialcompiler.dev/v1/compile with your API key as a bearer token, the mesh as multipart form data and a JSON options field. The OpenAPI description is at [/openapi/spatial-compiler.json](/openapi/spatial-compiler.json).

Compile over REST

The Rust gateway exposes the same operations over REST. Authenticate with your API key as a bearer token in the Authorization header, and send the mesh as multipart form data with a JSON options field.

terminal
curl -X POST https://api.spatialcompiler.dev/v1/compile \
  -H "Authorization: Bearer spck_test_example" \
  -F "file=@model.glb" \
  -F 'options={"target_tris":15000,"dry_run":true}'
The OpenAPI description of POST https://api.spatialcompiler.dev/v1/compile is at /openapi/spatial-compiler.json.

Responses

StatusMeaning
200Typed telemetry JSON: see Telemetry fields.
401Missing or invalid API key: see API keys.
429The per-key hourly velocity limit is reached: see dry_run, cache and limits.