Predictable by design.
Five-minute developer quickstart
- Add a “Connect with Cascacore” button.
- POST your display name to
/oauth/device/authorize. - Open the returned
verification_uri_completein the customer's browser. - Poll
/oauth/device/tokenno faster than the returned interval. - Store the one-time token in the platform credential vault and send it as a bearer token.
GET /api/v1/account/credits Authorization: Bearer cc_live_CUSTOMER_SECRET X-Cascacore-Request-Id: STABLE_REQUEST_UUID
Authentication
Send Authorization: Bearer … on every v1 request. Each authorization creates a separately revocable customer-owned installation. Manually generated credentials may also use X-Cascacore-Install-Id and X-Cascacore-Api-Key.
What your customer does
The customer clicks your button, signs in or creates an account, adds $10 for 5,000 credits through Stripe, chooses whether to enable auto-refill at the final $1, and approves your application. Cascacore then returns the credential directly to your polling application. No copying or pasting is required.
Credit accounting
Successful billable responses include X-Cascacore-Credits-Charged, X-Cascacore-Credits-Remaining, and X-Cascacore-Usage-Id. Usage receipts distinguish the tariff value in credits_used from the wallet debit in credits_charged. A 402 response uses the stable code insufficient_credits.
Retries and idempotency
Provide a stable X-Cascacore-Request-Id when retrying. The same install, request ID, and operation cannot produce duplicate usage charges. Back off on 429 and transient 5xx responses.
Graceful degradation
Treat 402 and service failures as an online enhancement failure. Never block local library access or playback because Cascacore cannot answer.