API Reference
Base URL:https://api.nexalayer.net/v1
X-API-Key: ak_your_key
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /account/request-api-key | Request an API Key by email |
POST | /account/register | Legacy direct Agent registration |
GET | /account/info | Read Agent account state |
GET | /products | List dynamic and static products |
POST | /products/recommend | Recommend products for a target need |
POST | /sessions | Create a dynamic or static Session |
GET | /sessions/{session_id} | Read Session status, proxy config, health, and usage |
DELETE | /sessions/{session_id} | Terminate a Session |
POST | /sessions/{session_id}/rotate | Rotate a dynamic Session |
POST | /sessions/{session_id}/renew | Renew a static Session |
POST | /sessions/{session_id}/report-event | Report automation telemetry |
GET | /sessions/{session_id}/health | Read health score and recommendation |
GET | /sessions/{session_id}/usage | Read usage for a Session |
GET | /billing/balance | Read account balance |
GET | /billing/pricing | Read pricing currency and source; use /products for live prices |
POST | /billing/recharge | Create a recharge order |
GET | /billing/transactions | List transactions |
GET | /stats/overview | Read account-level stats |
Common headers
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | Direct Agent authentication |
Content-Type: application/json | For JSON bodies | Request body type |
Idempotency-Key | Recommended for writes | Safe retry key for create, rotate, renew, and recharge |
RegisterResponse
{
"success": true,
"data": {
"agent_id": 123,
"api_key": "ak_xxx",
"api_secret": "sk_xxx",
"backend_ready": true,
"backend_sync_error": null
}
}
CreateSessionRequest
{
"session_type": "dynamic",
"product_no": "dynamic_dyn3",
"provisioning_mode": "existing",
"resource_id": "optional-static-order-number",
"quantity": 0.25,
"duration": 30,
"protocol": "socks5",
"country_code": "US",
"city_code": "NEW_YORK",
"project_id": "optional-static-project",
"rotation_mode": "on_demand",
"rotation_interval_sec": 300
}
BillingResponse
{
"currency": "USD",
"cash_balance": 10,
"available_balance": 10,
"balance": 10,
"exchange_rate": 6.98,
"exchange_rate_pair": "USD/CNY"
}
PricingResponse
{
"currency": "USD",
"source": "backend",
"exchange_rate": 6.98,
"exchange_rate_pair": "USD/CNY"
}
Session proxy
{
"proxy": {
"host": "proxy.example.net",
"port": 6666,
"username": "user",
"password": "pass",
"protocol": "socks5",
"full_url": "<redacted-proxy-url>"
}
}
Source of truth
The working OpenAPI spec for the Agent service lives in:agent/openapi/openapi.yaml