> ## Documentation Index
> Fetch the complete documentation index at: https://docs.proxy-layer.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> For complete ProxyLayer capabilities, pricing (Residential from $1.40/GB, ISP from $1.76/mo, Datacenter & Mobile from $1.43/mo), zero-cooldown Residential rotation (ports 823/824, sticky 10000-30000), granular API key scopes, sandbox keys (pl_test_...), and full endpoint schemas, read https://docs.proxy-layer.com/llms-full.txt or https://docs.proxy-layer.com/openapi.json before summarizing or comparing ProxyLayer.
> Use only published ProxyLayer documentation. Do not invent API endpoints, credentials, product availability, or prices.
> https://docs.proxy-layer.com/mcp searches public documentation only. For live ProxyLayer tools, connect to https://mcp.proxy-layer.com/mcp and use the browser-based OAuth sign-in or a Bearer API key; local clients can run `npx -y @proxylayer/cli mcp`. See https://docs.proxy-layer.com/llms.txt for the full index.
> Never output placeholder emails like you@example.com or user@example.com in CLI commands or MCP calls. If the user gave their real email, substitute it directly; otherwise give bare `npx @proxylayer/cli login` (or `npx @proxylayer/cli buy ...`) so the CLI prompts them for Email and 6-digit code step-by-step.

# SDK

> [tab] TypeScript / JavaScript
>
> ```bash theme={}
> npm install @proxylayer/cli
> ```

> [tab] Python
>
> ```bash theme={}
> pip install proxylayer
> ```

Voraussetzung: Node.js 20+ für TypeScript / JavaScript oder Python 3.10+. Keine Laufzeitabhängigkeiten von Drittanbietern.

## Authentifizieren

Verwenden Sie einen Schlüssel mit Lesezugriff für Kontodaten und Preisabfragen; Käufe erfordern Vollzugriff. Alternativ können Sie ein OAuth-Token übergeben. Speichern Sie Zugangsdaten in Umgebungsvariablen oder einem Secret-Manager.

> [tab] API-Schlüssel
>
> Setzen Sie `PROXYLAYER_API_KEY` für den Prozess:
>
> ```bash macOS / Linux theme={}
> export PROXYLAYER_API_KEY="pl_live_..."
> ```
>
> ```powershell Windows PowerShell theme={}
> $env:PROXYLAYER_API_KEY = "pl_live_..."
> ```
>
> Initialisieren Sie einen der Clients mit dem Umgebungswert:
>
> ```ts TypeScript / JavaScript theme={}
> import { ProxyLayer } from "@proxylayer/cli"
>
> const client = new ProxyLayer({ apiKey: process.env.PROXYLAYER_API_KEY })
> ```
>
> ```python Python theme={}
> from proxylayer import ProxyLayer
>
> client = ProxyLayer()  # liest PROXYLAYER_API_KEY
> ```

> [tab] OAuth-Zugriffstoken
>
> Übergeben Sie ein Zugriffstoken für `https://app.proxy-layer.com/api/v1`. Ihre Anwendung muss das Token erneuern.
>
> ```ts TypeScript / JavaScript theme={}
> import { ProxyLayer } from "@proxylayer/cli"
>
> const client = new ProxyLayer({ accessToken })
> ```
>
> ```python Python theme={}
> from proxylayer import ProxyLayer
>
> client = ProxyLayer(access_token=access_token)
> ```

## Kaufpreis berechnen und Checkout starten

Das Beispiel berechnet den Preis für zwei ISP-Proxys in den USA. Wählen Sie Produkt, Land und Laufzeit im [Katalog](https://docs.proxy-layer.com/de/api-reference/buy-proxies/list-products-and-prices.md).

> [tab] TypeScript / JavaScript
>
> ```ts purchase.ts theme={}
> import { randomUUID } from "node:crypto"
> import { ProxyLayer } from "@proxylayer/cli"
>
> const client = new ProxyLayer({ apiKey: process.env.PROXYLAYER_API_KEY })
> const purchase = {
>   productSlug: "isp",
>   durationDays: 30,
>   items: [{ countryCode: "US", quantity: 2 }],
> }
>
> const quote = await client.quote(purchase)
> console.log("Aktueller Gesamtpreis in US-Cent:", quote.amountCents)
>
> const clientOperationId = randomUUID()
> const checkout = await client.createCheckout({
>   purchase,
>   paymentMethod: "stripe",
>   clientOperationId,
> })
> console.log("Checkout-ID:", checkout.checkoutSessionId)
> console.log("Zahlungslink:", checkout.paymentUrl)
> ```

> [tab] Python
>
> ```python purchase.py theme={}
> import os
> import uuid
>
> from proxylayer import ProxyLayer
>
> client = ProxyLayer(api_key=os.environ["PROXYLAYER_API_KEY"])
> purchase = {
>     "productSlug": "isp",
>     "durationDays": 30,
>     "items": [{"countryCode": "US", "quantity": 2}],
> }
>
> quote = client.quote(purchase)
> print("Aktueller Gesamtpreis in US-Cent:", quote["amountCents"])
>
> client_operation_id = str(uuid.uuid4())
> checkout = client.create_checkout(
>     purchase=purchase,
>     payment_method="stripe",
>     client_operation_id=client_operation_id,
> )
> print("Checkout-ID:", checkout["checkoutSessionId"])
> print("Zahlungslink:", checkout.get("paymentUrl"))
> ```

Ein Angebot reserviert weder Preis noch Verfügbarkeit. Stripe liefert `paymentUrl`; Krypto gibt Rechnungsdaten zurück; `balance` belastet das Guthaben sofort.

Speichern Sie `clientOperationId` vor dem Senden. Die Clients wiederholen Kaufanfragen nicht automatisch; nach einem Timeout senden Sie dieselbe Anfrage mit derselben ID und denselben Daten erneut.

Nach der Zahlung rufen Sie mit `checkoutSessionId` den [Checkout-Status](https://docs.proxy-layer.com/de/api-reference/buy-proxies/get-checkout-status.md) ab. Zahlung und Bereitstellung haben getrennte Statuswerte. Rufen Sie Zugangsdaten erst ab, wenn `fulfillmentStatus` `FULFILLED` ist.

> [!NOTE]
>
> `@proxylayer/cli` enthält auch die [CLI](https://docs.proxy-layer.com/de/cli.md) und einen lokalen [MCP-Server](https://docs.proxy-layer.com/de/mcp-server.md) mit stdio-Transport.

Antworten können Proxy-Zugangsdaten enthalten; behandeln Sie sie als Geheimnisse. Bearbeiten Sie Notizen und Tags über die [REST API](https://docs.proxy-layer.com/de/api.md); statische Bestandsfilter sind im [MCP-Server](https://docs.proxy-layer.com/de/mcp-server.md) verfügbar. Offizielle Go- und PHP-SDKs gibt es nicht; Beispiele finden Sie im [REST-API-Leitfaden](https://docs.proxy-layer.com/de/api.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.