OriginChain docs
examples · errors · 9 / 19

9. 402 - addon required

← Errors examples
what this error means

The endpoint is gated by an addon the tenant has not enabled yet. Unlike most error bodies, a 402 carries extra typed fields: the addon's short code, its human name, the monthly_usd price, and a purchase_url the dashboard surfaces as a one-click enable.

what triggers it

Calling a paid endpoint (here, natural-language SQL via /ask) before the ask addon is enabled.

POST /v1/tenants/:t/ask
curl -X POST "https://$OC_HOST/v1/tenants/$OC_TENANT/ask" \
  -H "Authorization: Bearer $OC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"question": "how many customers do I have?"}'
the canonical response body
{
  "error": "addon_required",
  "message": "natural-language SQL requires the 'ask' addon",
  "retry": false,
  "addon": "ask",
  "name": "Natural language SQL",
  "monthly_usd": 99,
  "purchase_url": "https://originchain.ai/app/addons?enable=ask"
}
how to recover
  • Open the purchase_url from the response body - the dashboard turns it into a one-click enable, no support ticket required.
  • Or enable programmatically: POST /v1/tenants/:t/addons with {"addon": "ask"}.
  • If you're building a UI on top of OriginChain, surface the name and monthly_usd fields so the user sees what they're enabling.
  • retry: false - the call needs the addon, not a retry. Once enabled, the same request will succeed.
common upstream causes
  • New tenant exploring paid endpoints during onboarding.
  • Trial period ended and the addon auto-disabled when the trial flipped to a paid plan without addons checked.
  • Different tenant in the same org has the addon - tokens are per-instance, not org-wide.
  • Free-tier customer hitting a paid surface from a tutorial.