Official Client Libraries

Integrate Faster with Maintained SDKs

Use official clients for JavaScript, Python, and PHP. The SDKs sit alongside the OpenAPI spec and public docs so teams can move from a first test call to a production integration faster.

The SDKs remove boilerplate around authentication, request handling, and error parsing while staying faithful to the API response model.

JavaScript (npm)

npm install @alectocore/sdk

Supports Node.js 18+ and browser-capable fetch runtimes.

Python (PyPI)

pip install alectocore-sdk

Pure Python client for Python 3.9+ with zero runtime dependencies.

PHP (Packagist)

composer require alectocore/sdk

PHP 8.0+ client with cURL-based transport and typed exceptions.

What the SDKs Cover

  • Authentication with your live API key
  • Core moderation requests and consistent error handling
  • Simple drop-in usage for common product stacks
  • A clean starting point before teams build their own wrappers

How to Choose

  • Use JavaScript for Node services and JS-heavy stacks
  • Use Python for internal tools, moderation backends, and scripting
  • Use PHP for Laravel, Symfony, WordPress, and PHP APIs
  • Use the OpenAPI spec if you want to generate your own client

Quickstart

JavaScript

import { AlectoCoreClient } from "@alectocore/sdk";

const client = new AlectoCoreClient({ apiKey: process.env.ALECTO_API_KEY });
const out = await client.moderate({ text: "you are an idiot" });
console.log(out.action, out.score);

Python

from alectocore_sdk import AlectoCoreClient

client = AlectoCoreClient(api_key="ak_live_xxx")
out = client.moderate({"text": "you are an idiot"})
print(out["action"], out["score"])

PHP

<?php
use AlectoCore\AlectoCoreClient;

$client = new AlectoCoreClient("ak_live_xxx");
$out = $client->moderate(["text" => "you are an idiot"]);
echo $out["action"] . " " . $out["score"];
Public docs, the OpenAPI spec, and the signed-in dashboard guide are kept aligned with the same product surface as the SDKs.