Sign-up API
Sign-up API
Self sign-up completes through an activation link: submit an email address, open the link in the email to confirm, and the account is created; the API Key is shown on the confirmation page and sent in a welcome email. The sign-up endpoints need no authentication.
export BASE_URL="https://api.xairouter.com"The service provider may turn self sign-up off, in which case every /x-sign request returns 403 {"success": false, "message": "Self-registration is currently disabled"}.
Flow
POST /x-sign: send the activation email; the link is valid for 10 minutes.GET /x-sign/activate?token=...: open the confirmation page; the user clicks to confirm.POST /x-sign/activate: create the account; the page shows the API Key and a welcome email is sent.
Opening the link (GET) only shows the confirmation page and never creates an account, so that email security scanners prefetching the link cannot activate it by mistake.
Send the activation email
curl -X POST "$BASE_URL/x-sign" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "referral_code": "pk-Xvs..."}'| Field | Required | Description |
|---|---|---|
email | Yes | Email address, converted to lowercase |
referral_code | No | The referrer's public identifier (pk-Xvs...; the referrer can get it from public_key in GET /dashboard/status) |
The request body may not exceed 64 KiB. Success response:
{"success": true, "message": "Verification code sent successfully", "data": {"email": "[email protected]"}}All responses use the {"success", "message", "data"} structure. Business errors return 400, with the reason in message:
message | Reason |
|---|---|
Invalid email address | The email format is invalid |
Email domain is not allowed for self-registration | The email domain is not allowed for self sign-up |
Email already registered | The email is already registered |
invalid referral code | The referral code does not exist or the referrer is disabled |
Please wait before requesting another verification code | The same email requested again within 2 minutes |
Too many verification codes requested from this IP today | Too many requests from the same IP today |
Failed to send verification email | The email could not be sent; try again later |
Activation
The link in the activation email is https://api.xairouter.com/x-sign/activate?token=<48-character token>.
GET /x-sign/activate?token=...: returns an HTML confirmation page.POST /x-sign/activate(form fieldtoken): creates the account and returns an HTML success page showing the new account's API Key.- An invalid or expired token shows
Invalid or expired activation link.
The account that is created:
| Property | Value |
|---|---|
| Account name | A randomly generated system name |
| Display name | Derived from the email prefix |
| API Key | A newly generated 51-character sk-Xvs key, plus a public identifier pk-Xvs... |
| Sign-up bonus | The amount is set by the service provider, valid for 1 month, shown as Sign-up bonus in credit_balance of GET /dashboard/info |
| Sub-account quota | 1 |
The new account's Level, Role, pricing, and rate limits inherit the defaults of the service it signs up to.
Abuse protection
Sign-up endpoints are rate limited per source IP. POST /x-sign and POST /x-sign/activate share the following limits:
| Limit | Value |
|---|---|
| Requests per minute / hour / day | 3 / 10 / 20 |
| Distinct emails per IP per day | 5 (checked in POST /x-sign only; exceeding it returns 400) |
| Progressive delay | The more requests within the same hour, the longer the response waits (up to 15 seconds) |
| Automatic block | After suspicious behavior reaches a threshold, the IP is blocked for 3 hours |
A request rejected by the rate or site-wide quota returns 429 with the body {"success": false, "message": "..."}.