Create a customer session
Returns a one-time link to a Runledger-hosted page where one customer sees their usage meters, pool balances, expiring credits and invoices, buys credits through checkout and, if you grant the scope, sets a spend limit or an auto top-up. The page carries your account’s name and branding, not Runledger’s. Set the look once in account_settings.customer_view_branding, or per session with branding. The link works for that customer and those scopes only, until expires_at, and it is not an API key. Create the session from your backend when the customer opens your billing screen, and redirect them to url. The link opens once: the browser that opens it first keeps the page, through a cookie, until expires_at, and the same link opened anywhere else shows a page that says it was used and sends the customer back to return_url. Don’t email it, since a mail scanner that follows links would use it up. A link that has expired shows a page that sends the customer back to return_url. Never put an API key in a browser. Agent keys can’t create sessions.
Authentication
A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.
Request
Response
The one-time link to send the customer to. Treat it as a secret until it is used.