---
title: "Spatial Compiler REST API: POST /v1/compile with an API key"
description: "Call Spatial Compiler over REST: POST /v1/compile with your API key as a bearer token, the mesh as multipart form data and JSON options, per the OpenAPI spec."
canonical: https://appliedmanifold.com/docs/rest-api/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Docs](https://appliedmanifold.com/docs/)
3.  REST API

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

```sh
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](https://appliedmanifold.com/openapi/spatial-compiler.json).

## Responses

| Status | Meaning |
| --- | --- |
| 200 | Typed telemetry JSON: see [Telemetry fields](https://appliedmanifold.com/docs/telemetry/). |
| 401 | Missing or invalid API key: see [API keys](https://appliedmanifold.com/docs/api-keys/). |
| 429 | The per-key hourly velocity limit is reached: see [dry\_run, cache and limits](https://appliedmanifold.com/docs/limits/). |
