Authentication
Every connection is checked live when it opens. There is no long-lived signed token: the server looks your credential up on each connect, so a revoked key stops working on its next connection, not when some token expires.
API keys
Section titled “API keys”- Format:
opa_followed by 32 random URL-safe characters, for exampleopa_3mZ…. - We store only a SHA-256 hash of each key. We cannot show you a key again: if you lose one, revoke it and issue a new one.
- A key belongs to your team. You can have several (one per environment is a good habit) and revoke any of them independently.
Sending the key
Section titled “Sending the key”Server-side clients send it as a header:
Authorization: Bearer opa_your_key_hereAuthorization: apikey opa_… and a bare key in the header are accepted too.
If your client cannot set headers, put the key in the connect payload instead:
{ "key": "opa_your_key_here" }In the Centrifugo clients that is the data option (data={"key": KEY} in Python, data: { key } in JavaScript). If both are present, the header wins.
Browser tokens
Section titled “Browser tokens”Never ship an opa_ key to a web page; anyone can read it from the network tab. Instead:
- Your backend holds the key and exchanges it for a short-lived token (prefix
opt_). - The browser connects with that token in the connect payload,
data: { key: token }. - Tokens live for 2 minutes. When one expires the connection is refused with code
4501; fetch a fresh token and reconnect.
A token carries exactly the same entitlements as the key behind it, and stops working the moment that key is revoked.
Refusals
Section titled “Refusals”Missing, wrong, expired and revoked credentials all get the same answer — disconnect code 4501 with reason invalid api key (or no api key if none was sent). This is deliberate: the response cannot be used to probe whether a key exists. See Errors.
Odds compares prices only. It is not a bookmaker, takes no bets and does not tell you what to back. Prices come from licensed Australian bookmakers' public sites and can change at any moment; always check the price with the bookmaker before you bet.
18+ · Chances are you're about to lose. For free and confidential support call 1800 858 858 or visit gamblinghelponline.org.au