---
title: "Install"
description: "Install and pin the PHP or Python SDK for the Panel API. Manual + Composer for PHP, pip + requirements.txt for Python. Requirements, version pinning, upgrading, verification."
---

# Install

Both SDKs are MIT licensed and hosted on GitHub. PHP lives at [github.com/Xtream-AI/api-panel-php-sdk](https://github.com/Xtream-AI/api-panel-php-sdk) and Python at [github.com/Xtream-AI/api-panel-python-sdk](https://github.com/Xtream-AI/api-panel-python-sdk). Every published tag is treated as a stable release — the tag name is what you pin to in production.

## Requirements

| SDK | Language runtime | HTTP stack | Extra deps |
|---|---|---|---|
| PHP | PHP 8.1+ | `ext-curl` + `ext-json` (bundled with most PHP builds) | none |
| Python | Python 3.10+ | `requests` 2.28+ (installed transitively) | none |

`ext-curl` ships with the standard PHP release from every mainstream distro. If your PHP was compiled minimally, install it first: `apt-get install php8.2-curl` (Debian/Ubuntu) or `yum install php-curl` (RHEL/Rocky). The SDK will refuse to load at import time if the extension is missing, with a clear message.

## PHP

Two install paths. Pick based on how the rest of your project handles dependencies.

### Option A. Manual install (no Composer)

Simplest path for older projects, one-off scripts, or a single-file server-side integration.

1. Download the release ZIP: [v1.0.0 archive](https://github.com/Xtream-AI/api-panel-php-sdk/archive/refs/tags/v1.0.0.zip).
2. Extract next to your script. You get a folder named `api-panel-php-sdk-1.0.0/`.
3. Require the bundled autoloader:

```php
<?php
require __DIR__ . '/api-panel-php-sdk-1.0.0/autoload.php';

use XtreamAI\PanelApi\PanelApiClient;
```

No terminal, no lockfile. The `__DIR__` matters — it resolves to the directory of the file being executed, so the require works no matter which working directory PHP is invoked from. Drop it and a cron running from `/` will fail with a "file not found" error the first time it fires.

To upgrade, download the new ZIP, extract it side-by-side, and change the folder name in the `require` line. Delete the old folder when you are done.

### Option B. Composer

Natural choice if your project already uses Composer. The package is distributed over its Git repository (not on Packagist), so you register the VCS repository first, then require the package.

```bash
composer config repositories.xtream-ai vcs https://github.com/Xtream-AI/api-panel-php-sdk
composer require xtream-ai/api-panel-php-sdk:^1.0
```

The `^1.0` constraint pins you to any 1.x release. Composer picks the latest matching tag when you run `composer update`. Your `composer.lock` is what actually pins a specific commit for reproducible installs.

From then on your code uses the usual Composer autoloader:

```php
<?php
require 'vendor/autoload.php';

use XtreamAI\PanelApi\PanelApiClient;
```

## Python

Install straight from GitHub. The package is not on PyPI yet, so pip pulls the tagged release from the repository:

```bash
pip install "git+https://github.com/Xtream-AI/api-panel-python-sdk.git@v1.0.0"
```

Pin the exact tag in production. `pip install "git+…@main"` picks whatever is on the default branch at install time and is a foot-gun for reproducible deploys.

If you use `requirements.txt`, add this line:

```
xtream-ai-api-panel-sdk @ git+https://github.com/Xtream-AI/api-panel-python-sdk.git@v1.0.0
```

For Poetry:

```bash
poetry add "git+https://github.com/Xtream-AI/api-panel-python-sdk.git@v1.0.0"
```

Then import the client the usual way:

```python
from xtream_ai_panel_api import PanelApiClient
```

## Verify the install

The smallest thing you can do with either SDK is ask the panel who you are. It is one HTTP call, needs no data, and confirms your token works, the base URL is right, and the panel is reachable.

```bash
# curl smoke test — no SDK needed, useful as a baseline
curl -H "Authorization: Bearer <your-api-key>" \
     https://<your-panel-domain>/panel-api/v1/me
```

```php
<?php
require __DIR__ . '/api-panel-php-sdk-1.0.0/autoload.php';

use XtreamAI\PanelApi\PanelApiClient;

$client = new PanelApiClient(
    baseUrl: 'https://<your-panel-domain>',
    token:   '<your-api-key>',
);

$me = $client->me->get();
echo "OK — authenticated as ", $me->type, PHP_EOL;
```

```python
from xtream_ai_panel_api import PanelApiClient

client = PanelApiClient(
    base_url="https://<your-panel-domain>",
    token="<your-api-key>",
)

me = client.me.get()
print(f"OK — authenticated as {me.type}")
```

A `200` and a printed identity line means the install is good. A 401 means the token is not recognised; a connect timeout means the base URL is wrong or the panel is unreachable. Both are covered in [Authentication with the SDK](/docs/?page=panel-api-sdk-auth).

## Upgrading

Both SDKs follow semver. Any 1.x → 1.y upgrade is backward-compatible (new methods, bug fixes, additional exception subclasses). Any 1.x → 2.x involves breaking changes and comes with a written migration note in the release.

- **PHP manual**: download the new ZIP, extract, update the `require` path. Delete the old folder.
- **PHP Composer**: `composer update xtream-ai/api-panel-php-sdk`. If pinned to `^1.0`, this pulls the latest 1.x. Bumping to `^2.0` requires editing `composer.json`.
- **Python**: `pip install --upgrade "git+…@v1.1.0"`. Or update the tag in `requirements.txt` and rerun `pip install -r requirements.txt`.

The release notes for every tag ship on the GitHub Releases page.

## Uninstall

- **PHP manual**: delete the extracted folder and remove the `require` line.
- **PHP Composer**: `composer remove xtream-ai/api-panel-php-sdk` and drop the VCS repository registration if nothing else uses it.
- **Python**: `pip uninstall xtream-ai-api-panel-sdk`.

## See also

- [SDKs Overview](/docs/?page=panel-api-sdks). What the SDKs give you compared to hand-rolled HTTP.
- [Quickstart](/docs/?page=panel-api-quickstart). Create your first line end to end.
- [Authentication with the SDK](/docs/?page=panel-api-sdk-auth). Constructing the client, rotating tokens, calling `me()`.
