Create Token
/resi/token/createAuthentication
Basic username/password authentication
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| dataLimit | integer | Required | Data limit in bytes. The token will expire when dataUsage reaches this limit Validation: Must be at least 1000000 (1 MB) |
| username | string | Optional | Username for proxy authentication. Must be exactly 8 characters. If not provided, a random 8-character alphanumeric username will be auto-generated Validation: Must be exactly 8 characters Default: Auto-generated 8-character alphanumeric string |
| durationHours | integer | Optional | Number of hours until the token expires. If set to 0, token will not expire based on time. Maximum value is 87600 (10 years) Validation: Must be a non-negative integer, maximum 87600 (10 years) Default: 0 (unlimited duration) |
dataLimit
RequiredData limit in bytes. The token will expire when dataUsage reaches this limit
Must be at least 1000000 (1 MB)
username
OptionalUsername for proxy authentication. Must be exactly 8 characters. If not provided, a random 8-character alphanumeric username will be auto-generated
Must be exactly 8 characters
durationHours
OptionalNumber of hours until the token expires. If set to 0, token will not expire based on time. Maximum value is 87600 (10 years)
Must be a non-negative integer, maximum 87600 (10 years)
Code Example
- NodeJS
- Python
- PHP
- Java
- C#
- cURL
- Javascript
- Go
const axios = require('axios');
const url = "https://api.unknownproxies.com/api/v1/resi/token/create";
const headers = {
"Authorization": "Basic dXNlcjpwYXNz",
"Content-Type": "application/json"
};
const data = {
"dataLimit": 0,
"username": "your-username-here",
"durationHours": 0
};
try {
const response = await axios.post(url, {
headers,
data
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
import requests
import json
url = "https://api.unknownproxies.com/api/v1/resi/token/create"
headers = {
"Authorization": "Basic dXNlcjpwYXNz",
"Content-Type": "application/json"
}
data = {
"dataLimit": 0,
"username": "your-username-here",
"durationHours": 0
}
response = requests.post(
url,
headers=headers,
json=data
)
print(response.json())
<?php
$url = "https://api.unknownproxies.com/api/v1/resi/token/create";
$headers = [
"Authorization: Basic dXNlcjpwYXNz",
"Content-Type: application/json"
];
$data = {
"dataLimit": 0,
"username": "your-username-here",
"durationHours": 0
};
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.google.gson.Gson;
public class ApiClient {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String url = "https://api.unknownproxies.com/api/v1/resi/token/create";
String auth = "Basic dXNlcjpwYXNz";
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", auth)
.header("Content-Type", "application/json");
// Add request body if needed
String jsonBody = {
"dataLimit": 0,
"username": "your-username-here",
"durationHours": 0
};
HttpRequest request = requestBuilder
.post(HttpRequest.BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http.Headers;
using Newtonsoft.Json;
public class Program
{
public static async Task Main()
{
using var client = new HttpClient();
var url = "https://api.unknownproxies.com/api/v1/resi/token/create";
// Set basic auth
var authToken = Convert.ToBase64String(Encoding.UTF8.GetBytes("user:pass"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authToken);
var data = new {
// Define your request object here
};
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.postAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
curl -X POST "https://api.unknownproxies.com/api/v1/resi/token/create" \
-H "Authorization: Basic dXNlcjpwYXNz" \
-H "Content-Type: application/json" \
-d '{
"dataLimit": 0,
"username": "your-username-here",
"durationHours": 0
}'
const response = await fetch("https://api.unknownproxies.com/api/v1/resi/token/create", {
method: "POST",
headers: {
"Authorization": "Basic dXNlcjpwYXNz",
"Content-Type": "application/json"
},
body: {
"dataLimit": 0,
"username": "your-username-here",
"durationHours": 0
}
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.unknownproxies.com/api/v1/resi/token/create"
reqBody := `
{
"dataLimit": 0,
"username": "your-username-here",
"durationHours": 0
}
`
var body io.Reader
if reqBody != "" {
var buf bytes.Buffer
if err := json.Compact(&buf, []byte(reqBody)); err == nil {
body = bytes.NewBuffer(buf.Bytes())
} else {
body = bytes.NewBuffer([]byte(reqBody))
}
}
req, _ := http.NewRequest("POST", url, body)
token := base64.StdEncoding.EncodeToString([]byte("user:pass"))
req.Header.Set("Authorization", "Basic "+token)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b))
}
Response Example
{
"token": "zu8sBXS4gkh7",
"username": "kGyohRda",
"authType": "user",
"password": "bkXBberMQ7",
"durationHours": 0,
"status": "active",
"createdAt": 1752251968,
"updatedAt": 1752251968,
"dataUsage": 0,
"dataLimit": 100000000000,
"allowedPools": []
}Notes
Upon creation, the token status is always "active". Username is optional and must be exactly 8 characters if provided (auto-generated if not specified). Password is automatically generated and returned in the response - it cannot be specified in the request. Username/password authentication is the only authentication method for residential tokens.
Token Creation Details
Required Fields
dataLimit- The only required field. Specifies the maximum data usage in bytes before the token expires. The value must be at least 1,000,000,000 (1 GB) and provided in whole gigabyte increments (multiples of 1,000,000,000 bytes).
Auto-Generated Fields
username- Automatically generated as a random 8-character alphanumeric stringpassword- Automatically generated as a random 8-character alphanumeric string
Optional Fields
durationHours- Defaults to0(unlimited duration, expires only when data limit is reached)
Residential tokens always use the generated username/password credentials for authentication. Residential proxies do not support IP authentication yet.
Resellers cannot decrease a token's dataLimit after creation; increases must still follow the whole-gigabyte rule.
Token Behavior
Duration Hours
durationHours: 0- Token never expires based on time, only when dataUsage >= dataLimitdurationHours > 0- Token expires after the specified number of hours OR when dataUsage >= dataLimit, whichever comes first
Allowed Pools
- Upon creation,
allowedPoolsis set to an empty array[], meaning the token can access all available proxy pools - You can restrict pool access later using the Modify Residential Token endpoint
After Creating a Token
Once your token is created, you can:
- Retrieve Residential Token - Get detailed information about your token
- Modify Residential Token - Update pool access, limits, or rotate the password
For complete details on all token fields, see the Residential Token Schema documentation.