ARCNM

Building blocks

Rate limits

Per-key and per-caller limits, the 429 envelope, Retry-After and how to back off safely. Every 429 costs nothing, so a rejected call is never a billed call.

ARCNM enforces a per-minute budget per caller, a ceiling per API key and a few per-address limits; exceed one and you get 429, and every 429 costs €0. Calculations you pay for are not rate-limited by your plan.

The per-minute budget — one per API key (each key has its own), one per organization for the signed-in app's calculation starts and heavy calls (its reads and light writes are counted per person in the interactive bucket below). Windows are fixed minutes; each call draws its weight:

Free Pro Scale Enterprise
Budget, weighted units per minute 180 300 600 1,200, or as your agreement states (a figure, or unlimited)
A read or an ordinary write 1 1 1 1
A calculation start (see below) 1 0 — not limited 0 0
A heavy call (see below) 25 25 10 5

The other limits:

Limit Applies to Ceiling
Per API key every /api/v1 request with one key 1,200 requests/min — or your Enterprise agreement's rate limit where that is higher (unlimited: none)
Interactive bucket a signed-in person's light requests in the ARCNM app (reads and light writes), instead of the organization's budget 1,200 requests/min per person
Unverified key checks requests with one key from one address that fail to authenticate 120/min
Unknown key prefixes requests from one address naming no key 600/min
MCP calls per key MCP calls with one API key from one address still awaiting an answer 120 at once
Upload links uploads through one link / from one address 20 attempts/min per link, 30 uploads/min per address
Sign-in and account routes per address: e.g. signup 3/hour, magic link and email code 5 per 5 min, MFA verify 5/min, session refresh 30/min per route

MCP tool calls are API calls: they draw from the same budget and the same per-key ceiling as the REST call they make.

When a limit is hit you get 429. All 429s cost €0.

These are current defaults and may change. Plan-tier entitlements (calculations/month, storage) are a separate axis — see Pricing.


The 429 envelope

There are two 429 codes depending on which limiter fired:

  • The per-caller rate-limit bucket returns rate_limited with the limit and window in details:

    {
      "error": {
        "code": "rate_limited",
        "message": "Submission rate limit reached (600 weighted calls per 60s) — retry in 12s.",
        "details": { "limit": 600, "window_seconds": 60 }
      },
      "request_id": "req_…"
    }
    
  • The interactive bucket returns rate_limited too, with its own message and the same details: "Interactive rate limit reached (1200 requests per 60s for each signed-in person) — retry in 12s."

  • The per-address limits (sign-in and account routes, upload links) and the per-key ceiling return too_many_requests. So does the MCP per-key cap: its message names mcp_key_auth_failure even when every call carried a valid key — the cap counts a call until it is answered, so a burst of more than 120 at once is refused until earlier calls finish.


Budget headers

Every authenticated REST response carries the per-caller rate-limit bucket's budget so you can pace yourself before hitting 429:

Header Meaning
X-RateLimit-Limit The per-caller ceiling for the current minute window.
X-RateLimit-Remaining Budget left in the window. Weighted — a heavy op (a what-if cost preview, attaching an input file, machine selection, starting or previewing a job nest, an AI call) consumes your plan's heavy-operation weight (25, for example) while a read consumes 1 — so this is true headroom, not a raw request count. A calculation start is not a heavy op: see below.
X-RateLimit-Reset UTC epoch second the window rolls over and the budget resets.
RateLimit The same budget in the IETF structured-field form (draft-ietf-httpapi-ratelimit-headers): "default";r=<remaining>;t=<seconds-to-reset>.
RateLimit-Policy The active policy: "default";q=<budget>;w=60 (budget q per 60-second window w).

The legacy X-RateLimit-* triplet and the standards-track RateLimit / RateLimit-Policy pair carry the same numbers — read whichever your HTTP client supports.

The headers describe the bucket the request was counted in. A call with an API key or a scoped OAuth grant, and a signed-in session's calculation start or heavy operation, report your plan's budget under the policy name default. A signed-in session's light request reports that person's interactive bucket instead — X-RateLimit-Limit: 1200, RateLimit-Policy: "interactive";q=1200;w=60 — never plan headroom it did not spend; the plan's headroom is on the response of the session's next heavy operation.

On a per-caller 429 you also get Retry-After (seconds until reset). Honour it when present; otherwise fall back to the backoff below. The auth-route limiter and the per-key ceiling don't emit these headers — they're a coarse floor, not a budget you meter against.


Retry strategy

Exponential backoff with full jitter. Always pair retries with an Idempotency-Key so a retry can't double-charge.

import random, time, requests

def with_retry(fn, *, max_attempts=5, cap_s=30):
    for attempt in range(max_attempts):
        resp = fn()
        if resp.status_code != 429:
            return resp
        wait = random.uniform(0, min(cap_s, (2 ** attempt)))
        time.sleep(wait)
    raise RuntimeError(f"giving up after {max_attempts} attempts")
async function withRetry(fn: () => Promise<Response>, maxAttempts = 5, capMs = 30_000) {
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
    const res = await fn()
    if (res.status !== 429) return res
    const wait = Math.random() * Math.min(capMs, 2 ** attempt * 1_000)
    await new Promise((r) => setTimeout(r, wait))
  }
  throw new Error(`giving up after ${maxAttempts} attempts`)
}
for attempt in 0 1 2 3 4; do
  resp=$(curl -sw '\n%{http_code}' "$URL" -H "X-API-Key: $ARCNM_API_KEY")
  code=$(printf '%s' "$resp" | tail -n1)
  body=$(printf '%s' "$resp" | sed '$d')
  if [ "$code" = "200" ] || [ "$code" = "201" ] || [ "$code" = "202" ]; then echo "$body"; exit 0; fi
  if [ "$code" != "429" ] && [ "$code" -lt 500 ]; then echo "$body" >&2; exit 1; fi
  sleep $(awk -v n=$((2 ** attempt)) 'BEGIN{srand(); print n*rand()}')
done

What counts toward the limit

  • Every authenticated REST call of an API key or a scoped OAuth grant, and every MCP tool call, counts toward the per-minute budget and the per-key ceiling.
  • A signed-in session in the ARCNM app is not paced by your plan's budget for its light requests: reads and light writes are counted per person in the interactive bucket (1,200 a minute), so browsing, polling a running calculation and editing never take headroom from your submissions or from colleagues. Its calculation starts and heavy operations — a run, an upload, a re-price, the regional screen, an include_total count, starting or previewing a job nest — draw your plan's budget exactly as an API key's do. A session token an MCP client sends is paced on the plan's budget.
  • Calculation starts — upload-and-quote, POST /calculations/quote, POST /calculations/{id}/run (and a component's /run), POST /calculations/batch, POST /calculations/bulk-retry, a re-price (POST /calculations/{id}/reprice and POST /calculations/reprice) and pricing a calibration import (POST /calibration/imports/{import_id}/price, one calculation per (part, lot) pair) — are metered by your plan (included calculations, then overage from the prepaid balance), not priced as heavy work here. On Free each start counts as one ordinary request; on Pro, Scale and Enterprise it counts nothing and is never refused with rate_limited, however fast you submit — only the per-key ceiling of 1,200 requests a minute applies, and one batch carries up to 500 calculations. A batch still costs one plan-quota unit per (revision × environment) cell.
  • Heavy calls — work your plan does not meter per call: a what-if POST /calculations/{id}/preview, attaching an input file, machine selection, starting or previewing a job nest, AI calls, the account export, and a list read with include_total=true (one unit again when the count comes from cache). POST /setup/imports and POST /environments/{env_id}/setup/changes are one heavy call however many rows they write, and so is POST /environments/{env_id}/setup/changes/preview, whatever the number of changes: the plan tries every write it plans. A list's preview (POST /setup/imports/preview) and GET /environments/{env_id}/setup count as the reads they make.
  • A setup call that runs out of budget answers 429 rate_limited with Retry-After, also when it is one of its own reads that was not answered. Nothing was written: wait, and send the same request again.
  • Sign-in and account calls (signup, magic link, email code, MFA, account recovery) hit the per-address limits above, not your budget.
  • Calculations run in a queue: each organization runs a bounded number at once (Free 2, Pro 6, Scale 12, Enterprise 24) and the rest wait their turn — never a 429.
  • Webhook deliveries we send to you don't count — those are our egress.

Need more headroom?

If a key is hitting the ceiling, email hello@arcnm.io with your use case and we'll size it to your forecast.


See also