PHPackages                             styley/styley-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. styley/styley-php-sdk

ActiveLibrary

styley/styley-php-sdk
=====================

PHP SDK for the STYLEY AI Platform

07PHP

Since May 2Pushed 1y agoCompare

[ Source](https://github.com/pingponglabs-backend/styley-php-sdk)[ Packagist](https://packagist.org/packages/styley/styley-php-sdk)[ RSS](/packages/styley-styley-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

🚀 Styley - PHP SDK
==================

[](#-styley---php-sdk)

📥 **Install PHP**
-----------------

[](#-install-php)

### Option 1: Install Using System Package Manager (Linux/Unix)

[](#option-1-install-using-system-package-manager-linuxunix)

**For Ubuntu/Debian:**

```
sudo apt update
sudo apt install php php-cli php-mbstring unzip curl
```

**For CentOS/RHEL:**

```
sudo yum install epel-release
sudo yum install php php-cli php-mbstring unzip curl
```

Option 2: Install Using Homebrew (MacOS)
----------------------------------------

[](#option-2-install-using-homebrew-macos)

```
brew update
brew install php
```

### Option 3: Install PHP on Windows

[](#option-3-install-php-on-windows)

1. Download the PHP installer:

    👉
2. Extract the files to C:\\php.
3. Add PHP to System PATH:

    - Open Control Panel → System → Advanced System Settings → Environment Variables.
    - Edit the Path variable and add:

```
C:\php
```

4. Restart your terminal to apply changes.

**Verify Installation**
-----------------------

[](#verify-installation)

Check if PHP is installed and working correctly.

```
php -v
```

**Expected output:**

```
PHP 8.1.2 (cli) (built: Jan 22 2024 13:05:35) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
```

If you see "command not found," double-check that PHP is installed and is in your PATH.

**📦Install Composer**
---------------------

[](#install-composer)

Composer is a dependency manager for PHP, like npm for JavaScript or pip for Python.

**Option 1: Automatic Installation (Linux/MacOS)**

```
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
```

**Option 2: Install Using Installer (Windows)**

1. Download the Composer installer: 👉
2. Follow the on-screen instructions.
3. Verify Composer installation:

    ```
    composer -v
    ```

**Expected output:**

```
Composer version 2.6.0 2024-04-10 00:13:15
```

Note: If you see "command not found," ensure Composer is installed and is in your PATH.

📁 **Setup Project Workspace**
-----------------------------

[](#-setup-project-workspace)

Create a project directory:

```
mkdir php-sdk-project
cd php-sdk-project
```

Create a composer.json file in the project directory:

```
touch composer.json
```

Add the below content into `composer.json`

```
{
  "name": "your-project-name",
  "require": {}
}
```

📦 Installation
--------------

[](#-installation)

Install the Styley PHP SDK via Composer.

```
composer require styley/styley-php-sdk:dev-main
```

⚙️ Usage
--------

[](#️-usage)

This guide demonstrates how to initialize the SDK and interact with the available methods for deployments and models.

🌐 Set `X_STYLEY_KEY` Environment Variable
-----------------------------------------

[](#-set-x_styley_key-environment-variable)

### PowerShell

[](#powershell)

```
$env:X_STYLEY_KEY = "your-api-key-here"
```

### Bash

[](#bash)

```
export X_STYLEY_KEY="your-api-key-here"
```

🏆 **Deployments**
=================

[](#-deployments)

### 📤 Create Deployment

[](#-create-deployment)

The **Create Deployment** method allows you to create a new deployment using a `model name` and `arguments`. It returns an output with a `job_id` that you can use to fetch the final results.

```
