generate()
Generate proxy credentials
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.
Signature
client.proxies.generate(options: ProxiesGenerateOptions): Promise<ProxiesGenerateResponse>Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
acceptLanguage | string | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
body | GenerateProxyRequest | Required | — |
Example
const result = await client.proxies.generate({ body: { "package_id": "550e8400-e29b-41d4-a716-446655440000", "quantity": 1 }});Returns
GenerateProxyResponseThe resource or action result was created successfully.
typeGenerateProxyResponse2fields
countnumberproxiesGeneratedProxy[]typeGeneratedProxy6fields
hoststringportnumberprotocolstringusernamestringpasswordstringconnection_stringstringThrows
ApiErrorNormalized API, transport, and response processing failure.
kind: "validation"The request arguments or business rules are invalid.kind: "authentication"Authentication credentials are missing, expired, or invalid.kind: "permission"The authenticated account cannot perform this operation.kind: "not_found"The requested resource does not exist.kind: "network"The request could not reach ProxyRequest.kind: "unexpected"The response could not be decoded or did not match the SDK contract.
Advanced variants
client.proxies.generateWithResponse(options): Promise<ApiResponse<ProxiesGenerateResponse>>Returns response status, headers, ETag and idempotency metadata with the decoded data.
Signature
client.proxies.generate(*, body: GenerateProxyRequest, accept_language: str | Unset=UNSET) -> GenerateProxyResponseawait async_client.proxies.generate(*, body: GenerateProxyRequest, accept_language: str | Unset=UNSET) -> GenerateProxyResponseParameters
| Name | Type | Requirement | Description |
|---|---|---|---|
accept_language | str | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
body | GenerateProxyRequest | Required | — |
Example
result = client.proxies.generate( body=models.GenerateProxyRequest.from_dict({'package_id': '550e8400-e29b-41d4-a716-446655440000', 'quantity': 1}), )Async example
result = await async_client.proxies.generate( body=models.GenerateProxyRequest.from_dict({'package_id': '550e8400-e29b-41d4-a716-446655440000', 'quantity': 1}), )Returns
GenerateProxyResponseThe resource or action result was created successfully.
classGenerateProxyResponse2fields
countintproxieslist[GeneratedProxy]classGeneratedProxy6fields
hoststrportintprotocolstrusernamestrpasswordstrconnection_stringstrThrows
ApiErrorNormalized API, transport, and response processing failure.
ErrorKind.VALIDATIONThe request arguments or business rules are invalid.ErrorKind.AUTHENTICATIONAuthentication credentials are missing, expired, or invalid.ErrorKind.PERMISSIONThe authenticated account cannot perform this operation.ErrorKind.NOT_FOUNDThe requested resource does not exist.ErrorKind.NETWORKThe request could not reach ProxyRequest.ErrorKind.UNEXPECTEDThe response could not be decoded or did not match the SDK contract.
Advanced variants
client.proxies.generate_with_response(*, body: GenerateProxyRequest, accept_language: str | Unset=UNSET) -> ApiResponse[GenerateProxyResponse]Returns response status, headers, ETag and idempotency metadata with the decoded data.
Signature
$client->proxies()->generate($generateProxyRequest, $acceptLanguage = null, string $contentType = self::contentTypes['generate'][0])Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
acceptLanguage | string | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
generateProxyRequest | GenerateProxyRequest | Required | — |
Example
$result = $client->proxies()->generate( generateProxyRequest: new Dto\GenerateProxyRequest([ 'package_id' => '550e8400-e29b-41d4-a716-446655440000', 'quantity' => 1, ]),);Returns
GenerateProxyResponseThe resource or action result was created successfully.
classGenerateProxyResponse2fields
countintproxies[GeneratedProxy[]](GeneratedProxy.md)classGeneratedProxy6fields
hoststringportintprotocolstringusernamestringpasswordstringconnectionStringstringThrows
ApiExceptionNormalized API, transport, and response processing failure.
ErrorKind::ValidationThe request arguments or business rules are invalid.ErrorKind::AuthenticationAuthentication credentials are missing, expired, or invalid.ErrorKind::PermissionThe authenticated account cannot perform this operation.ErrorKind::NotFoundThe requested resource does not exist.ErrorKind::NetworkThe request could not reach ProxyRequest.ErrorKind::UnexpectedThe response could not be decoded or did not match the SDK contract.
InvalidArgumentExceptionA required argument is missing or violates a local SDK constraint.
local validationThe request was rejected before it was sent.
Advanced variants
$client->proxies()->generateWithResponse($generateProxyRequest, $acceptLanguage = null, string $contentType = self::contentTypes['generate'][0]): \ProxyRequest\ApiResponseReturns an ApiResponse with decoded data and HTTP metadata.
$client->proxies()->generateWithHttpInfo($generateProxyRequest, $acceptLanguage = null, string $contentType = self::contentTypes['generate'][0])Returns the OpenAPI Generator response tuple.
$client->proxies()->generateAsync($generateProxyRequest, $acceptLanguage = null, string $contentType = self::contentTypes['generate'][0])Returns a Guzzle promise for the decoded result.
$client->proxies()->generateAsyncWithHttpInfo($generateProxyRequest, $acceptLanguage = null, string $contentType = self::contentTypes['generate'][0])Returns a Guzzle promise for the response tuple.
$client->proxies()->generateRequest($generateProxyRequest, $acceptLanguage = null, string $contentType = self::contentTypes['generate'][0])Builds the PSR-7 request without sending it.