The official SDKs expose the same authenticated API v2 operations as typed resource methods. Use them in trusted server-side applications; never ship an account API token to browser code.
| SDK | Runtime | Package | Source |
|---|---|---|---|
| JavaScript / TypeScript | Node.js 22 or newer | @ltesocks/sdk | GitHub |
| Python | Python 3.11 or newer | ltesocks-sdk | GitHub |
| PHP | PHP 8.3 or newer | ltesocks/php-sdk | GitHub |
Install
Section titled “Install”Choose a language. The selection is kept for every SDK example on this site.
# npmnpm install @ltesocks/sdk
# pnpmpnpm add @ltesocks/sdk
# Yarnyarn add @ltesocks/sdkpip install ltesocks-sdkcomposer require ltesocks/php-sdkCreate a client
Section titled “Create a client”Set LTESOCKS_API_TOKEN in the process environment, then initialize the client. The production base URL and authorization header are configured automatically.
import { LTESocksClient } from '@ltesocks/sdk';
const client = LTESocksClient.withBearerToken( process.env.LTESOCKS_API_TOKEN, { language: 'en' },);import os
from ltesocks_sdk import Client
client = Client.with_bearer_token( os.environ["LTESOCKS_API_TOKEN"], language="en",)<?php
use LTESocks\Client;
require __DIR__ . '/vendor/autoload.php';
$client = Client::builder() ->withBearerToken((string) getenv('LTESOCKS_API_TOKEN')) ->withLanguage('en') ->build();Synchronous and asynchronous Python
Section titled “Synchronous and asynchronous Python”The examples in this documentation use the synchronous Client for compactness. Applications with an async event loop can use AsyncClient with the same resource names and await each operation:
import os
from ltesocks_sdk import AsyncClient
async with AsyncClient.with_bearer_token( os.environ["LTESOCKS_API_TOKEN"], language="en",) as client: user = await client.user.get() print(user.login)Client behavior
Section titled “Client behavior”- Each SDK defaults to
https://api.ltesocks.io/v2and sendsAccept-Language. - Typed resources cover users, ports, payments, plans, servers, and signatures.
- Supported mutations receive an idempotency key automatically. Transport failures without an HTTP response can be retried with the same key; HTTP error responses are not retried automatically.
- Error classes preserve status, response details, retry timing, headers, and the request idempotency key when available.
- A raw request method is available as an escape hatch for a newly added endpoint until the SDK is regenerated.
Keep the SDK version pinned in production and review its changelog before upgrades. The OpenAPI contract remains the source of truth for endpoint and model details.
Continue with the quickstart or make your first request.