PHP code example of cblink / gptlink-sdk

1. Go to this page and download the library: Download cblink/gptlink-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cblink / gptlink-sdk example snippets


use \Cblink\Service\Develop\Application;
    
$config = [
    'api_key' => 'xxxxxxxx',
    'base_url' => 'https://api.gpt-link.com',
];

$app = new Application($config);

$data = [
    'prompt' => '一个漂亮的年轻女孩,手持魔杖,穿洛丽塔服装,站立姿势',
    'model' => 22,
    'width' => 512,
    'height' => 512,
    'creativity_degree' => 60
];

// 请求数据
$response = $app->image->create($data);

var_dump($response);