Connection & Usage
Monitor active VPN connections, view connection history, and retrieve usage statistics.
Get Active Connection
Check the current VPN connection status for the authenticated user, including the connected server, protocol, duration, and data transferred.
/api/v1/vpn/connectionGet the active VPN connection status
curl -X GET https://api.orbai.world/api/v1/vpn/connection \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"success": true,
"data": {
"is_connected": true,
"connection": {
"stats_id": 50001,
"server": {
"id": 101,
"host_name": "us-nyc-01.orbvpn.com",
"public_ip": "203.0.113.10",
"type": "premium",
"city": "New York",
"country": "US",
"continent": "NA",
"crypto_friendly": true,
"bridge_capable": false,
"bridge_country": null,
"bridge_priority": 0,
"description": "Premium US East Coast server",
"hidden": false
},
"protocol": "wireguard",
"connected_at": "2026-02-08T09:00:00Z",
"duration_secs": 5400,
"data_transferred": 157286400,
"tokens_earned": 12.5,
"client_ip": "198.51.100.50"
}
}
}{
"success": true,
"data": {
"is_connected": false,
"connection": null
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired access token"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
is_connected | boolean | Whether the user has an active VPN connection |
connection.stats_id | integer | Unique connection statistics identifier |
connection.server | object | Full server object (same as Server Details response) |
connection.protocol | string | Active VPN protocol (wireguard, vless, orbconnect) |
connection.connected_at | string | ISO 8601 timestamp of when the connection was established |
connection.duration_secs | integer | Connection duration in seconds |
connection.data_transferred | integer | Total bytes transferred during the session |
connection.tokens_earned | number | ORB tokens earned during this connection |
connection.client_ip | string | The client's public IP address |
Connection History
Retrieve a paginated list of past VPN connections for the authenticated user.
/api/v1/vpn/historyGet the user's VPN connection history
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | Optional | Page number for pagination (default: 1) |
per_page | integer | Optional | Results per page (default: 25, max: 100) |
curl -X GET "https://api.orbai.world/api/v1/vpn/history?page=1&per_page=25" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"success": true,
"data": {
"connections": [
{
"id": 90001,
"server_id": 101,
"server_name": "us-nyc-01.orbvpn.com",
"server_country": "US",
"protocol": "wireguard",
"connected_at": "2026-02-08T09:00:00Z",
"disconnected_at": "2026-02-08T10:30:00Z",
"duration_secs": 5400,
"bytes_sent": 52428800,
"bytes_received": 104857600,
"client_ip": "198.51.100.50"
},
{
"id": 90000,
"server_id": 205,
"server_name": "de-fra-01.orbvpn.com",
"server_country": "DE",
"protocol": "vless",
"connected_at": "2026-02-07T14:00:00Z",
"disconnected_at": "2026-02-07T18:45:00Z",
"duration_secs": 17100,
"bytes_sent": 209715200,
"bytes_received": 524288000,
"client_ip": "198.51.100.50"
}
],
"total": 142,
"page": 1,
"per_page": 25,
"total_pages": 6
}
}History Response Fields
| Field | Type | Description |
|---|---|---|
connections[].id | integer | Unique connection record ID |
connections[].server_id | integer | Server ID used for the connection |
connections[].server_name | string | Hostname of the connected server |
connections[].server_country | string | Country code of the connected server |
connections[].protocol | string | VPN protocol used |
connections[].connected_at | string | Connection start timestamp |
connections[].disconnected_at | string | Connection end timestamp |
connections[].duration_secs | integer | Total connection duration in seconds |
connections[].bytes_sent | integer | Total bytes uploaded |
connections[].bytes_received | integer | Total bytes downloaded |
connections[].client_ip | string | Client IP address during the connection |
Usage Statistics
Retrieve aggregate VPN usage statistics for the authenticated user.
/api/v1/vpn/usageGet aggregate VPN usage statistics
curl -X GET https://api.orbai.world/api/v1/vpn/usage \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"success": true,
"data": {
"total_data_transferred": 10737418240,
"total_connection_time_secs": 864000,
"total_sessions": 142,
"average_session_time_secs": 6084,
"total_tokens_earned": 350.75
}
}Usage Response Fields
| Field | Type | Description |
|---|---|---|
total_data_transferred | integer | Total bytes transferred across all sessions |
total_connection_time_secs | integer | Total time connected in seconds |
total_sessions | integer | Total number of VPN sessions |
average_session_time_secs | integer | Average session duration in seconds |
total_tokens_earned | number | Total ORB tokens earned from VPN usage |
Data Conversion
The total_data_transferred and bytes_sent/bytes_received values are in bytes. Divide by 1073741824 (1024^3) to convert to gigabytes, or by 1048576 (1024^2) for megabytes.
Token Earnings
ORB tokens are earned while connected to the VPN. The earning rate depends on your subscription plan and connection duration. Check the Tokens section for more details on the token economy.