Skip to main content

ProxyRequest Python SDK

CI PyPI Python

Official synchronous and asynchronous Python client for the ProxyRequest public API. It covers 79 supported operations in the current contract: users, orders, proxy generation, analytics, invoices, packages, locations, webhooks, API keys, Telegram integration, and more.

What is ProxyRequest?

ProxyRequest is a white-label proxy platform for operators and resellers that already have upstream proxy supply. It provides the product and control layer needed to turn that supply into a customer-facing service:

  • managed HTTP, HTTPS, SOCKS5, and SOCKS5h gateways;
  • packages, users, orders, proxy credentials, limits, and byte accounting;
  • geographic and network targeting, sticky sessions, and multi-provider routing;
  • customer and reseller dashboards, invoices, coupons, and payment flows;
  • analytics, signed webhooks, API keys, and operational reporting.

You can use the complete managed backend and customer dashboard, or keep your own frontend, identity, and billing while ProxyRequest handles provisioning, routing, accounting, and analytics headlessly. You retain your brand, pricing, customer relationships, and upstream provider contracts.

ProxyRequest is not an upstream bandwidth plan. Provider traffic and contracts remain separate from the platform subscription. See the platform overview for the complete operating boundary.

How this SDK fits

The REST API is the control plane around proxy traffic. This SDK provisions resources and reads their state; customer proxy requests go to the managed gateway servers instead of passing through the SDK or REST API.

Your Python backend ── HTTPS/JSON ──> ProxyRequest API
Customer traffic ───── HTTP/SOCKS ──> Managed gateways ──> Destination

Keep the credentials for those paths separate: API keys belong only in trusted backend code, while generated proxy usernames and passwords are supplied only to the customer or workload that connects to a gateway.

The most important resource relationships are:

Customer purchase:
Package -> Invoice -> Paid invoice -> Order / data ledger -> Proxy credentials

Reseller provisioning:
Eligible root order -> Sub-user + child allocation -> Proxy credentials

Invoices describe commercial state. Orders and data ledgers describe service entitlement. Creating an invoice or returning from checkout is therefore not proof that proxy access is active.

Choose an integration path

Scenario Recommended flow
Built-in customer checkout Select a package, create an invoice, obtain its payment link, confirm payment and entitlement, then generate proxy credentials.
Reseller-managed customer Create a sub-user, assign a package and byte limit from an eligible root order, then generate credentials for that user.
Existing headless platform Keep your own customer and billing records, persist mappings to ProxyRequest users/packages/orders, and provision through the API.

See purchase a package with an invoice and provision a reseller customer for complete Python examples.

Installation

python -m pip install proxyrequest-sdk

Python 3.11 or newer is required. The package uses httpx and includes both sync and async clients.

Quick start

import os

from proxyrequest_sdk import Client
from proxyrequest_sdk.models import UserCreateRequest

with Client.with_api_key(os.environ["PROXYREQUEST_API_KEY"]) as client:
    profile = client.profile.get()
    user = client.users.create(
        body=UserCreateRequest(
            username="customer-reference",
            password=os.urandom(32).hex(),
        )
    )
    print(profile.username, user.id)

Static API keys are sent as Authorization: Static YOUR_API_KEY. Never expose them to browser code.

The asynchronous API has the same resource and method names:

import os

from proxyrequest_sdk import AsyncClient


async def list_users() -> None:
    async with AsyncClient.with_api_key(os.environ["PROXYREQUEST_API_KEY"]) as client:
        page = await client.users.list(limit=100)
        for user in page.results:
            print(user.username)

Resource API

Client and AsyncClient expose 17 API groups. The pinned public schema contains 81 operations; disabled sessions_list and sessions_destroy operations are intentionally excluded. Sticky session options in proxy generation remain supported.

See backend compatibility and MFA for updated login examples and response-model migration notes.

client.authorization
client.users
client.profile
client.orders
client.proxies
client.analytics
client.invoices
client.coupons
client.rewards
client.affiliates
client.packages
client.locations
client.api_keys
client.webhooks
client.telegram
client.settings
client.news

All operation parameters and return values are typed. Request and response models live in proxyrequest_sdk.models, use snake_case attributes, and expose to_dict() / from_dict() helpers. IDs follow their OpenAPI type (UUID or opaque str), and all byte amounts are Python integers.

See the generated API resource reference and model reference.

Automatic retries and optimistic concurrency

The SDK automatically protects supported writes during up to three total attempts after a network failure, or after 409 Conflict with a numeric Retry-After of at most five seconds. Other HTTP errors are returned immediately. This protection applies inside one running call. If the process stops before saving the result, inspect the affected resource before submitting another write:

response = client.users.create_with_response(
    body=UserCreateRequest(username="customer-reference", password="secret"),
)

print(response.data.id, response.etag)

Every generated method has a _with_response variant exposing status_code, headers, and etag.

Operations that declare If-Match accept the latest strong ETag. A stale value raises ApiError with ErrorKind.PRECONDITION and exposes the current server value as current_etag. ETags are explicit response metadata and are not cached by the SDK.

Pagination

List endpoints return their typed OpenAPI page. Use paginate() to follow all pages lazily:

with Client.with_api_key(os.environ["PROXYREQUEST_API_KEY"]) as client:
    for user in client.paginate(client.users.list, limit=100):
        print(user.username)

The asynchronous variant is also lazy:

async with AsyncClient.with_api_key(os.environ["PROXYREQUEST_API_KEY"]) as client:
    async for user in client.paginate(client.users.list, limit=100):
        print(user.username)

Errors

Every documented and undocumented HTTP failure is normalized to ApiError. Network and decoding problems use the same contract:

from proxyrequest_sdk import ApiError, ErrorKind

try:
    client.profile.get()
except ApiError as error:
    if error.kind is ErrorKind.AUTHENTICATION:
        # Replace the invalid API key or bearer token.
        pass
    print(error.status_code, error.request_id, error.field_errors)

Supported writes receive bounded automatic retries for transient failures. JWTs are never refreshed automatically; call client.authorization.refresh(...) explicitly when your application owns a token pair.

Configuration and custom deployments

import httpx

client = Client.with_api_key(
    os.environ["PROXYREQUEST_API_KEY"],
    base_url="https://customer-api.example/api/v1",
    language="uk",
    timeout=20,
    connect_timeout=5,
)

An existing httpx.Client or httpx.AsyncClient can be supplied through http_client. It must have the same base_url; the SDK applies its auth, language, and user-agent headers but leaves closing the external client to the caller. The request() method is an authenticated escape hatch for endpoints introduced before the next SDK release.

Invoice downloads

download = client.download_invoice_pdf(invoice_id)
path = download.save(f"./{download.filename}")
print(path, download.content_type)

save() does not overwrite an existing file unless overwrite=True is passed.

Webhook verification

Verify the exact raw body before decoding it:

from proxyrequest_sdk import WebhookVerifier

payload = WebhookVerifier.decode_verified_json(
    raw_body,
    request.headers.get("X-Signature", ""),
    os.environ["PROXYREQUEST_WEBHOOK_SECRET"],
)

Deliveries use standard padded Base64 HMAC-SHA256 over the raw body, without a signed timestamp. Verification accepts only this current format. It authenticates the body, but does not prevent replay: deduplicate usage events in your application. These helpers require SDK 2.0.0 or newer; version 1.0.0 does not support the current delivery format.

Platform documentation

Development

uv sync --all-groups
make quality
make generate-check
make build

The vendored schema is pinned in openapi/source.json. Run make sync-openapi SOURCE=/path/to/openapi.yml, followed by make generate, to update it. Generation is pinned and CI rejects uncommitted contract changes.

License

MIT

Release files for proxyrequest-sdk 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for proxyrequest-sdk 2.0.0
File Size Uploaded
proxyrequest_sdk-2.0.0.tar.gz 298.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for proxyrequest-sdk 2.0.0
File Interpreter ABI Platform
proxyrequest_sdk-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 991.4 kB

Release files / proxyrequest_sdk-2.0.0.tar.gz

Download URL proxyrequest_sdk-2.0.0.tar.gz
Size 298.0 kB
Tags Source
SHA-256 checksum
How to use checksums
90e182bb5a20e4adccca55d1cdb45d4170928d88549dedeffd9b6058bd3651ef
BLAKE2b-256 checksum
How to use checksums
34124b08b231b185ab7b0b2e792ea2f4dd17ce4f2c980a8f6ba1fffd509fa95e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / proxyrequest_sdk-2.0.0-py3-none-any.whl

Download URL proxyrequest_sdk-2.0.0-py3-none-any.whl
Size 693.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9aca30a9d5f20421b1f6e144dbbfce3451d26a1c2416e0c1277a4e8daf36475
BLAKE2b-256 checksum
How to use checksums
0c4fd83a0d103d87bae63169b764fd943402c41c83827108ab95075dba2ab49a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

4.1.0

2 release files

4.0.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

This release

2.0.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page