Documentation

Getting started

Five minutes from "get a key" to a working integration. The full endpoint-by-endpoint reference is below.

1

Get a key

Sign up for the Free plan (or any paid plan) — the storefront mints an API key on activation and shows it once in your client area. Keys look like ag_live_… (or ag_test_… in a sandbox).

2

Make your first request

Send the key in X-API-Key (or Authorization: Bearer). Query-string keys are rejected on purpose — they leak into logs.

curl https://api.<DOMAIN>/v1/spot/gold \
  -H "X-API-Key: ag_live_yourkeyhere"
3

Read the rate-limit headers

Every keyed response carries your current budget, so you can back off before you're throttled instead of guessing.

HeaderMeaning
X-RateLimit-LimitRequests/min allowed on your plan
X-RateLimit-RemainingTokens left in the current window (floored)
X-RateLimit-ResetEpoch seconds when the next token is available
4

Handle errors

Every error response is {"error", "message"} with one of these codes:

HTTPerrorWhen
401missing_keyNo key on a keyed route
401invalid_keyUnknown or revoked key
403payment_requiredKey suspended
403not_entitledActive key, missing dashboard entitlement / WS not on plan
429rate_limitedToken bucket empty (response includes retryAfterSeconds)
400/404existing codesUnchanged (unknown_metal, bad_query, …)
5

Stream over WebSocket

Connect to /v1/stream, then authenticate with your first message — no key in the URL. WebSocket access requires a paid plan.

> ws.connect("wss://api.<DOMAIN>/v1/stream")
< (connection open)
> {"type":"auth","key":"ag_live_yourkeyhere"}
< {"type":"auth_ok","plan":"pro","dashboard":true}
< {"type":"snapshot","payload":[ …every tracked metal… ]}
< {"type":"update","payload":[ …only metals that changed… ]}

No auth within 10s, a bad/revoked key, a suspended key, or a plan without WS/dashboard each get one JSON error frame and a close code (40014004) — see the reference below for the full table.

API reference

Every endpoint, generated from the spec

Rendered offline from openapi.yaml — no CDN, no network call beyond this site's own assets.