docs: invite mechanics - why balance is 0 and how to get your own /i/ link
This commit is contained in:
@@ -24,6 +24,38 @@ GET /pool/v1/models -> catalog
|
||||
POST /pool/v1/chat/completions -> OpenAI-compatible
|
||||
```
|
||||
|
||||
## Why the balance comes out `0.0000`
|
||||
|
||||
The onboarding credit is not an account feature, it is a **referral registration
|
||||
reward**. The server only pays it when the invite cookie is already present at the
|
||||
moment the account row is created.
|
||||
|
||||
```
|
||||
GET /i/<code> -> Set-Cookie: ara_invite ✔ credit will land
|
||||
GET /auth/oauth/github -> github ... -> ara_session -> credits 100000.0000
|
||||
|
||||
GET /auth/oauth/github -> github ... -> ara_session (no invite cookie)
|
||||
-> credits 0.0000, ledger empty
|
||||
```
|
||||
|
||||
Consequences, all verified against `/pool/balance`:
|
||||
|
||||
* Signing up from the homepage and *then* opening an invite link does nothing — the
|
||||
reward is attached to registration, not to the session.
|
||||
* Re-running the flow on an account that already exists does nothing either. The
|
||||
ledger keeps exactly one row: `{"kind":"invite","delta":"100000.0000"}`,
|
||||
`ledger_has_more:false`.
|
||||
* `ara_invite` is `HttpOnly`, so `document.cookie` shows nothing — a browser
|
||||
automation "check" of the invite state is meaningless, read `/pool/balance` instead.
|
||||
|
||||
Your own referral link is not rendered into the HTML; the page fetches it:
|
||||
|
||||
```bash
|
||||
python pool_client.py --cookie-file c.txt --no-key --my-invite --json
|
||||
# "my_invite": {"code":"XXXXXXXX","link":"https://modeloc.com/i/XXXXXXXX",
|
||||
# "reward_invitee":"100000","reward_invitee_enabled":true}
|
||||
```
|
||||
|
||||
## Traps (each one cost real debugging time)
|
||||
|
||||
| # | Symptom | Cause | Fix |
|
||||
@@ -34,6 +66,7 @@ POST /pool/v1/chat/completions -> OpenAI-compatible
|
||||
| 4 | `422 {"detail":[{"type":"dict_type"}]}` on `/pool/keys` | body not recognised as JSON | send `Content-Type: application/json` explicitly |
|
||||
| 5 | `403 error code 1010` on `/pool/v1/*` | Cloudflare TLS fingerprint blocks bare `urllib`/`requests` | `curl_cffi` with `impersonate="chrome"` |
|
||||
| 6 | balance looks like `0E+4` | scientific-notation zero from the API | it is a real zero — don't string-replace it into `10000` |
|
||||
| 7 | `spendable 0.0000` on a fresh account | the account was created before `ara_invite` existed, or it already existed | open `/i/<code>` **before** `/auth/oauth/github`; the account must be new |
|
||||
|
||||
Also worth knowing: a key can exist while `/pool/v1/models` answers 200 and
|
||||
`chat/completions` answers 402 — the key is valid, the balance is not.
|
||||
|
||||
Reference in New Issue
Block a user