Authentication & quotas

Access tiers

TierCreditsExpiryCard required
Anonymous100 / sessionSessionNo
Sandbox2,000 / month60 daysNo
Pay-as-you-goMetered, $0.05/creditYes
Strategic PartnershipCustomCustomCustom

Authentication patterns

API key (X-API-Key)

Server-to-server integrations. Recommended for backend integrations. Issue a long-lived key per integration via the portal at app2.mworks.com; rotate by minting a new key and revoking the old one.

GET /v2/markets HTTP/1.1
Host: api2.mworks.com
X-API-Key: mwk_live_...

Bearer JWT (Supabase OAuth)

Portal and PLG flows. JWTs are obtained via the in-app sign-in flow at app2.mworks.com and forwarded as Authorization: Bearer <jwt>. JWTs expire with the user session — they are not long-lived secrets.

GET /v2/billing/credits HTTP/1.1
Host: api2.mworks.com
Authorization: Bearer eyJ...

Anonymous access

Unauthenticated requests are allowed up to 100 credits per session (tracked by IP + a server-side session token). Anonymous requests are subject to stricter rate limits and cannot access historical-data endpoints.

Sandbox tier

New accounts receive 2,000 sandbox credits on signup — no card required, no waitlist. Sandbox credits expire after 60 days and do not auto-renew. Get a sandbox key at app2.mworks.com and verify it with the public health endpoint:

curl https://api2.mworks.com/v2/health \
  -H "X-API-Key: $MW_API_KEY"

Rate limits

TierLimit
Anonymous5 req/min
Sandbox10 req/min
Production / Pay-as-you-go100 req/min
Enterprise1,000 req/min

Rate-limit responses return HTTP 429 with a Retry-After header.

Error codes

CodeHTTPMeaning
UNAUTHORIZED401Missing or invalid auth
FORBIDDEN403Valid auth, insufficient permissions
QUOTA_EXCEEDED402Credit balance at zero — hard stop
RATE_LIMITED429Too many requests