WireGuard Configuration
Retrieve a WireGuard VPN configuration for a specific server, including interface and peer settings.
Get WireGuard Configuration
Retrieve a complete WireGuard VPN configuration for a specific server. The response includes all interface and peer settings needed to establish a connection, along with a ready-to-use configuration file content.
/api/v1/vpn/servers/{serverId}/wireguardGet WireGuard configuration for a specific server
| Parameter | Type | Required | Description |
|---|---|---|---|
serverId | integer | Required | The numeric ID of the VPN server |
device_id | integer | Optional | Specific device ID to generate the configuration for. Defaults to the current device. |
Authorize First
You should call the VPN Authorization endpoint before fetching a configuration to ensure the user is eligible to connect.
# Basic request
curl -X GET https://api.orbai.world/api/v1/vpn/servers/101/wireguard \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
# With specific device
curl -X GET "https://api.orbai.world/api/v1/vpn/servers/101/wireguard?device_id=1001" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"success": true,
"data": {
"interface": {
"private_key": "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=",
"address": "10.66.66.2/32",
"dns": ["1.1.1.1", "1.0.0.1"],
"mtu": 1420
},
"peer": {
"public_key": "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=",
"endpoint": "203.0.113.10:51820",
"allowed_ips": ["0.0.0.0/0", "::/0"],
"persistent_keepalive": 25
},
"config": "[Interface]\nPrivateKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=\nAddress = 10.66.66.2/32\nDNS = 1.1.1.1, 1.0.0.1\nMTU = 1420\n\n[Peer]\nPublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=\nEndpoint = 203.0.113.10:51820\nAllowedIPs = 0.0.0.0/0, ::/0\nPersistentKeepalive = 25"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired access token"
}
}{
"success": false,
"error": {
"code": "ACCESS_DENIED",
"message": "Your subscription plan does not include access to this server. Please upgrade your plan."
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Server with the specified ID does not exist"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
interface.private_key | string | WireGuard private key for the client |
interface.address | string | Assigned tunnel IP address with subnet mask |
interface.dns | string[] | DNS servers to use while connected |
interface.mtu | integer | Maximum Transmission Unit size |
peer.public_key | string | Server's WireGuard public key |
peer.endpoint | string | Server endpoint in host:port format |
peer.allowed_ips | string[] | IP ranges to route through the tunnel |
peer.persistent_keepalive | integer | Keepalive interval in seconds |
config | string | Complete WireGuard configuration file content |
Private Key Security
The private_key in the response is unique to your session. Never share it publicly or commit it to version control. Each request generates fresh cryptographic keys.
Using the Config
The config field contains the entire WireGuard configuration as a single string. You can save it directly to a .conf file and import it into any WireGuard client.