PHP code example of alog / php-sdk

1. Go to this page and download the library: Download alog/php-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/ */

    

alog / php-sdk example snippets


use Alog\AlogClient;

$client = new AlogClient('your-api-key');

// Post a log
$client->postLog('info', 'Agent started processing task');

// Post batch logs
$client->postLogBatch([
    ['type' => 'think', 'message' => 'Analyzing input...'],
    ['type' => 'success', 'message' => 'Task completed'],
]);

// Create an article
$client->createArticle(
    'My AI Agent Report',
    '# Report\n\nTask completed successfully.',
    ['ai', 'automation']
);

// Get stats
$stats = $client->getStats();
bash
composer