Addresses

Application routes are under /v1; /health (readiness, 200 or 503) is not.

Conventions

  • JSON is snake_case. Request bodies are limited to 64 KiB and reject unknown fields.
  • Amounts are decimal strings of token base units: "1000000" is one USDC or pUSD; USDT has 18 decimals. Hyperliquid and Aster withdrawal messages sign decimal token amounts instead.
  • Response times are RFC 3339 UTC, except a quote line preparation’s valid_until and its drafts’ expires_at; those and request deadlines are Unix seconds. x-server-time is Unix milliseconds.
  • Order IDs are 32-byte hex; other resource IDs are UUIDs. Event cursors, revisions, generations and cancellation epochs are decimal strings: keep them lossless. Quote sequences are integers.
  • Client IDs (client_request_id, client_take_id, client_transfer_id) are 1–64 ASCII letters, digits, _, -, . or :.
  • Every response carries x-request-id and x-server-time. CORS exposes them and Retry-After to the app origins.

Authentication

Public market data needs no token. Private calls send Authorization: Bearer TOKEN. A master session comes from the SIWE challenge and verify routes; the message names APP_ORIGIN. It is required to link accounts, fund and close capital, take, transfer, withdraw and manage credentials. The session authenticates the request; the linked account owner still signs each financial item. A maker credential is an mk_ bearer bound to one quote identity and its quote signer: A credential never moves capital, links accounts, takes or closes orders, and never sees balances, withdrawals or other identities. Rotation replaces the bearer, keeps the identity and quote signer, and removes current quotes. A master session can call these routes too, for each of its identities. When /v1/info reports access.mode: "invite", an account makes new commitments only once it redeems an access code in the app or LaMarge grants access; until then, or while suspended, they answer ACCESS_REQUIRED.

Retries and recovery

Persist client_request_id, client_take_id or client_transfer_id before the first request. Repeating an ID with the same parameters returns the existing resource, whatever its state; other parameters answer STATE_CONFLICT. A new attempt after a cancelled, expired or failed one needs a new ID. There is no Idempotency-Key header. Recover a maker preparation by repeating its request or with GET /v1/maker/preparations/{id}, and a take with GET /v1/takes/{id}. Check state and deadlines before signing a recovered item. A venue withdrawal is deduplicated by its exact signed operation; resending it returns its record. For a take funded from venue margin, recover its transfer first. Live state: snapshot, then replay. The SDK follows these rules (errors and retries).

Errors

Every error except /health readiness has this shape:
Branch on code, never on message. Some errors add a stable reason, listed on their route, such as a refused delivery report. retryable is a transport hint, not permission to create a new economic intent. Any route may answer 429 or 500; route pages do not list them. On 429, or any error with Retry-After, wait that many seconds and retry the same request; retryable is then true. A path segment that is not UTF-8 once percent-decoded answers 400 VALIDATION_ERROR on any route.

Limits

GET /v1/info returns the deployment’s limits and settlement timings. Defaults: Public market data is not charged to a user’s request budget.