Skip to main content

Accounts

Agent accounts are created via POST /account/register. Each agent has a 1:1 mapping to a backend user for billing and orders.

Register

Creates an agent and returns api_key and api_secret. New agents receive a trial balance (e.g. ¥5) for testing. User Registration: A referral code** (optional) can be entered during registration. If a valid referral code is provided, the account will be assigned to the corresponding referring agent; if not provided or if the referral code is invalid, the account will be assigned to the default agent. An invalid referral code will return a 400 error. Example curl (referral code optional)**: The registration endpoint is POST /v1/account/register (in some environments, the path may be /v1/auth/register, subject to the actual deployment).
curl -X POST https://api.nexalayer.net/v1/account/register \
  -H "Content-Type: application/json" \
  -d '{"name":"My Agent","contact_email":"dev@example.com","referral_code":"0345"}'
curl -X POST "https://api.nexalayer.net/v1/account/register" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My AI Agent",
    "contact_email": "agent@example.com",
    "webhook_url": "https://my-server.com/webhook"
  }'

Request body

FieldTypeRequiredDescription
namestringYesAgent name (2–100 chars).
contact_emailstringNoContact email.
webhook_urlstringNoWebhook URL for event notifications.
descriptionstringNoDescription (max 500 chars).
referral_codestringNoReferral code from an agent. If valid, the account is assigned to that agent. If invalid, returns 400 error. If omitted, assigned to the default agent (openAgent).

Response fields

FieldDescription
api_keyUse in X-API-Key for all authenticated requests.
api_secretOnly needed for JWT; returned once — store securely.
referralPresent when a valid referral_code was provided. Contains the assigned agent info.
trialTrial balance and expiry; no recharge required to try sessions.

Get account info

curl -X GET "https://api.nexalayer.net/v1/account/info" \
  -H "X-API-Key: <api_key>"

Update account info

curl -X PUT "https://api.nexalayer.net/v1/account/info" \
  -H "X-API-Key: <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Agent Name",
    "webhook_url": "https://new-server.com/webhook"
  }'

Rotate secret

Invalidates the current api_secret and issues a new one (if your implementation returns it). Does not affect api_key or API-Key-only usage.
curl -X POST "https://api.nexalayer.net/v1/account/rotate-secret" \
  -H "X-API-Key: <api_key>"
After rotation, any existing JWT obtained with the old secret will be invalid; use the new secret to obtain a new token. Next: Products, Sessions.