Skip to content

Official SDKs

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.

SDKRuntimePackageSource
JavaScript / TypeScriptNode.js 22 or newer@ltesocks/sdkGitHub
PythonPython 3.11 or newerltesocks-sdkGitHub
PHPPHP 8.3 or newerltesocks/php-sdkGitHub

Choose a language. The selection is kept for every SDK example on this site.

Terminal window
# npm
npm install @ltesocks/sdk
# pnpm
pnpm add @ltesocks/sdk
# Yarn
yarn add @ltesocks/sdk

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' },
);

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)
  • Each SDK defaults to https://api.ltesocks.io/v2 and sends Accept-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.