Skip to content

Generate proxy credentials

POST
/proxies/generate
curl --request POST \
--url https://api.proxyrequest.com/api/v1/proxies/generate \
--header 'Accept-Language: de' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "package_id": "550e8400-e29b-41d4-a716-446655440002", "quantity": 2, "targeting": { "country": "us", "region": "california", "city": "los_angeles", "isp": "comcast" }, "connection": { "protocol": "http", "format": "{host}:{port}:{username}:{password}" }, "session": { "ttl": 60 } }'

Creates ready-to-use proxy credentials for a purchased package. Use targeting to choose a location or provider scope, connection to choose protocol and output format, and session to control sticky session lifetime. Omit connection.host to choose one random eligible gateway for the entire request. The default port comes from that gateway’s cluster. Targeting location does not select the entry gateway’s region. Explicit host and port remain supported for custom endpoints.

Accept-Language
string
default: en

Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es. Regional language tags and quality weights are accepted; unsupported or omitted values use English.

Examples
de

Validates proxy generation request data and builds generator config.

object
package_id
required

ProxyRequest package UUID used to generate credentials. Headless integrations must resolve this from their local product mapping.

string format: uuid
user_id

ProxyRequest sub-user UUID that will use the generated credentials. Resolve it from your local customer mapping. Must be the caller’s own sub-user, even for superusers. Omit to generate for the authenticated account. For an independent top-level customer, authenticate as that customer rather than sending its ID with a global key.

string format: uuid
quantity
required

Number of proxies to generate

integer
>= 1 <= 5000
targeting
object
continent

Target continent code.

string
<= 255 characters
country

Target country code.

string
<= 255 characters
region

Target region or state code.

string
<= 255 characters
city

Target city code.

string
<= 255 characters
pool

Proxy pool identifier.

string
<= 255 characters
asn

Target autonomous system number.

integer
<= 65536
isp

Target internet service provider.

string
<= 255 characters
os

Target operating system: linux, windows, ios, macos, android. Use comma-separated values only when combined OS targeting is enabled.

string
<= 255 characters
connection
object
protocol

Proxy protocol. * http - http * socks5 - socks5 * auto - auto

string
Allowed values: http socks5 auto
host

Gateway host. Leave empty to choose one available gateway for the entire request.

string
<= 255 characters
port

Gateway port. Leave empty to use the port for the selected protocol.

integer
>= 1 <= 65535
format

Connection string format.

string
default: {protocol}://{username}:{password}@{host}:{port} >= 1 characters
session
object
ttl

Sticky session lifetime in seconds. The accepted range is configured per deployment.

integer
default: 600 >= 1 <= 86400
Examples
ExampleGenerateHTTPProxiesForACountry

Generate HTTP proxies for a country

{
"package_id": "550e8400-e29b-41d4-a716-446655440002",
"quantity": 2,
"targeting": {
"country": "us",
"region": "california",
"city": "los_angeles",
"isp": "comcast"
},
"connection": {
"protocol": "http",
"format": "{host}:{port}:{username}:{password}"
},
"session": {
"ttl": 60
}
}

The resource or action result was created successfully.

Media typeapplication/json
object
count
required
integer
proxies
required
Array<object>
object
host
required
string
port
required
integer
protocol
required
string
username
required
string
password
required
string
connection_string
required
string
Examples
ExampleGeneratedProxyCredentials

Generated proxy credentials

{
"count": 2,
"proxies": [
{
"host": "proxy.thepremiumports.com",
"port": 8000,
"protocol": "http",
"username": "pkg-res-country-us-region-california",
"password": "proxy-password",
"connection_string": "proxy.thepremiumports.com:8000:pkg-res-country-us-region-california:proxy-password"
}
]
}

The request is malformed or violates a business rule.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExampleValidationError

Validation error

{
"non_field_errors": [
"The request could not be processed."
]
}
Content-Language
string

Language used for human-readable errors.

Authentication credentials are missing, expired, or invalid.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExampleAuthenticationRequired

Authentication required

{
"detail": "Authentication credentials were not provided."
}
Content-Language
string

Language used for human-readable errors.

The authenticated account cannot perform this operation.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExamplePermissionDenied

Permission denied

{
"detail": "You do not have permission to perform this action."
}
Content-Language
string

Language used for human-readable errors.

The requested resource does not exist in the current account scope.

Media typeapplication/json

Validation and API error payload. Field names may be added dynamically; field errors are returned as arrays of human-readable messages.

object
detail
string
non_field_errors
Array<string>
key
additional properties
One of:
string
Examples
ExampleResourceNotFound

Resource not found

{
"detail": "Not found."
}
Content-Language
string

Language used for human-readable errors.