Search by

Official PHP SDK for Alecto Core

v0.1.0 2026-03-22 16:29 UTC

This package is auto-updated.

Last update: 2026-09-22 18:05:45 UTC


README

Official PHP SDK for Alecto Core.

Requirements

  • PHP 8.0+
  • ext-curl
  • Alecto Core key

Install

composer require alectocore/sdk

Quickstart

<?php
use AlectoCore\AlectoCoreClient;

$client = new AlectoCoreClient("ak_live_xxx");
$out = $client->moderate(["text" => "you are an idiot"]);

echo $out["request_id"] . " " . $out["action"] . " " . $out["score"];

Supported methods

  • moderate(array $body): array
  • moderateHandle(array $body): array
  • moderateBatch(array $body): array
  • moderateStructured(array $body): array
  • categories(): array
  • feedback(array $body): array
  • queue(int $limit = 100): array
  • resolveQueueItem(string $requestId, array $body): array

Errors

Non-2xx responses throw AlectoCoreError with:

  • HTTP status
  • parsed response payload when available

Base URL override

$client = new AlectoCoreClient("ak_live_xxx", "http://localhost:8080");