Where the key goes
| Surface | Credential |
|---|---|
Local MCP server (@spatial-compiler/mcp) | The API key in the SPATIAL_API_KEY environment variable. |
REST (https://api.spatialcompiler.dev) | Authorization: Bearer <API key> in the header, never in a URL. |
Hosted MCP server (https://mcp.spatialcompiler.dev) | No key: an OAuth 2.1 browser login with PKCE (S256). |
Local spatial-compiler program with the Claude plugin | No credential. |
The example key
Keys start with spck_live_ for live use and spck_test_ for testing. Code samples on this site use the example key spck_test_example. Replace it with your own. New accounts start with $5 of usage on their USD balance.
curl -X POST https://api.spatialcompiler.dev/v1/compile \
-H "Authorization: Bearer $SPATIAL_API_KEY" \
-F "file=@model.glb" \
-F 'options={"target_tris":15000,"dry_run":true}'
Limits and errors
Questions
Where does the local MCP server read the API key?
From the SPATIAL_API_KEY environment variable. The local server runs no login flow.
How do I send the API key over REST?
As a bearer token in the header: Authorization: Bearer <API key>. Never put the key in a URL.
Does the hosted MCP server need an API key?
No. The hosted server at https://mcp.spatialcompiler.dev signs you in with an OAuth 2.1 browser login with PKCE (S256), so the client config holds no key.
What does a 401 mean?
The key is missing, revoked or invalid. Get a new key and replace the old one; a call over the hourly velocity limit gets a 429 instead.