PHPackages                             redeyed/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. [API Development](/categories/api)
4. /
5. redeyed/sdk

ActiveLibrary[API Development](/categories/api)

redeyed/sdk
===========

Official Redeyed API client for PHP — AI tools, Sentinel human verification &amp; IP reputation. Free to install; requires a Redeyed API key to activate.

1.1.0(4w ago)00MITPHPPHP &gt;=8.1

Since Jun 30Pushed 4w agoCompare

[ Source](https://github.com/Bruted/redeyed-php)[ Packagist](https://packagist.org/packages/redeyed/sdk)[ Docs](https://redeyed.com/developers)[ RSS](/packages/redeyed-sdk/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

redeyed/sdk (PHP)
=================

[](#redeyedsdk-php)

Official PHP client for the [Redeyed API](https://redeyed.com/developers) — AI creator tools, **Sentinel** human verification &amp; IP reputation. Dependency‑free (uses cURL), works in any PHP project or CMS.

> **Free to install. Activated by your API key.**The client refuses to run without a Redeyed API key (used for the AI, IP‑reputation and account endpoints). Create one in your Laboratory panel under **Developer → API Keys**.
>
> **Sentinel captcha verification does NOT use a developer API key.** Like reCAPTCHA/Turnstile, each site has its own **Site Key** (public, renders the widget) and **Secret Key** (verifies server‑side). Grab both from the Redeyed Lab under **Sentinel → Sites** — the Secret Key is shown once.

Install
-------

[](#install)

```
composer require redeyed/sdk
```

Requires **PHP 8.1+** with the `curl` and `json` extensions.

Quick start
-----------

[](#quick-start)

```
use Redeyed\Client;
use Redeyed\RedeyedException;

// A developer API key is required — the client throws without one.
// The Sentinel Secret Key is separate (see below) and used only by verify().
$redeyed = new Client(getenv('REDEYED_API_KEY'), [
    'secret_key' => getenv('SENTINEL_SECRET_KEY'), // your site's Sentinel Secret Key
]);

try {
    $me  = $redeyed->me();                    // account + remaining quota
    $rep = $redeyed->ip('8.8.8.8');           // IP reputation (omit arg = caller)

    // Server-side captcha check. Pass the token from the widget (rendered with
    // your public Site Key). The visitor's IP is auto-detected (proxy-aware) and
    // sent as `remoteip`; pass a second argument to override. Passes when
    // $result['success'] === true.
    $result = $redeyed->verify($tokenFromWidget);
    if (! $result['success']) {
        // reject the submission — outcome: $result['outcome'], score: $result['score']
    }

    $chat = $redeyed->aiChat(['messages' => [['role' => 'user', 'content' => 'Three taglines, please.']]]);
    $para = $redeyed->aiParaphrase(['text' => 'Make this confident.']);
    $img  = $redeyed->aiImage(['prompt' => 'a neon fox, cinematic']);
} catch (RedeyedException $e) {
    // $e->errorCode (e.g. insufficient_scope), $e->status (e.g. 403), $e->getMessage()
}
```

Methods
-------

[](#methods)

MethodEndpointScope`me()``GET /me``account:read``ip(?string $ip)``GET /ip/{ip?}``sentinel:ip``verify(string $token, ?string $remoteIp = null)``POST /sentinel/siteverify`Site Secret Key`aiChat(array $params)``POST /ai/chat``ai:chat``aiParaphrase(array $params)``POST /ai/paraphrase``ai:paraphrase``aiImage(array $params)``POST /ai/image``ai:image``kmsCreateKey($alias, $type, $description)``POST /kms/keys``kms:keys``kmsKeys()``GET /kms/keys``kms:keys``kmsKey($alias)``GET /kms/keys/{alias}``kms:keys``kmsRotate($alias)``POST /kms/keys/{alias}/rotate``kms:keys``kmsEncrypt($alias, $plaintext, $aad)``POST /kms/keys/{alias}/encrypt``kms:encrypt``kmsDecrypt($alias, $ciphertext, $aad)``POST /kms/keys/{alias}/decrypt``kms:decrypt``kmsDataKey($alias, $bytes)``POST /kms/keys/{alias}/data-key``kms:encrypt``kmsDecryptDataKey($alias, $wrappedKey)``POST /kms/keys/{alias}/data-key/decrypt``kms:decrypt``kmsSign($alias, $message)``POST /kms/keys/{alias}/sign``kms:sign``kmsVerify($alias, $message, $signature)``POST /kms/keys/{alias}/verify``kms:sign`Each returns the unwrapped `data` array, or throws `RedeyedException` on an error response.

Encryption (KMS)
----------------

[](#encryption-kms)

Managed-key encryption over the developer API — grant your key the `kms:*` scopes. Redeyed holds the key material; you call the API to use a key.

```
// One-time: create a key (symmetric for encrypt/decrypt, or 'signing' for Ed25519).
$redeyed->kmsCreateKey('orders', 'symmetric');

// Encrypt a small secret. Optional $aad is bound into the ciphertext and must
// match on decrypt — great for tying a value to a record id.
$enc = $redeyed->kmsEncrypt('orders', '4111 1111 1111 1111', 'order:8842');
$ciphertext = $enc['ciphertext'];

// Decrypt (returns plaintext_b64, plus plaintext when valid UTF-8).
$dec = $redeyed->kmsDecrypt('orders', $ciphertext, 'order:8842');
echo $dec['plaintext'];

// Envelope encryption for large data: get a data key, encrypt locally, store the
// wrapped key beside your data, then unwrap it when you need to read.
$dk = $redeyed->kmsDataKey('orders');            // ['plaintext_key_b64' => ..., 'wrapped_key' => ...]
$plainKey = $redeyed->kmsDecryptDataKey('orders', $dk['wrapped_key'])['plaintext_key_b64'];

// Signing keys (Ed25519):
$sig = $redeyed->kmsSign('webhooks', $payload)['signature'];
$ok  = $redeyed->kmsVerify('webhooks', $payload, $sig)['valid'];
```

Rotate a symmetric key with `kmsRotate('orders')` — the key version is embedded in every ciphertext, so data encrypted before the rotation still decrypts. Full reference: .

Sentinel captcha verification
-----------------------------

[](#sentinel-captcha-verification)

No developer API key is involved. Each site gets a **Site Key** and a **Secret Key** from the Redeyed Lab under **Sentinel → Sites** (the Secret Key is shown once).

- **Site Key** — public. Render the widget with it on your page.
- **Secret Key** — private. Verifies the token server‑side. Pass it as the `secret_key` option (or set `SENTINEL_SECRET_KEY`).

`verify()` POSTs `{"secret": "…", "response": "", "remoteip": ""}` to `POST /sentinel/siteverify` (no `X-Api-Key` header). The response is:

```
['success' => true|false, 'outcome' => '…', 'score' => 0.9]
```

Verification passes when `success === true`.

**Proxy-aware `remoteip`.** Because verification is a server-to-server call, the visitor's IP is sent as `remoteip` so the token is matched against the IP that actually solved the challenge — otherwise Sentinel sees your server's IP and the token never matches ("verified but the form fails" behind proxies/CDNs). When you don't pass an IP, `verify()` auto-detects one via `Client::clientIp()`, preferring `CF-Connecting-IP`, then the first `X-Forwarded-For` entry, then `X-Real-IP`, then `REMOTE_ADDR` (each validated as a real IP). Forwarded headers are client-spoofable, so only rely on them behind a proxy/CDN that sets them; pass an explicit IP to `verify($token, $ip)` to bypass detection. If no Secret Key is configured, `verify()` **fails open** (returns `success => true`, `outcome => 'skipped_no_secret'`) so a mis‑configured deploy never locks users out — use `hasSecret()` to check whether it's actually wired up.

Configuration
-------------

[](#configuration)

```
new Client($apiKey, [
    'secret_key'    => getenv('SENTINEL_SECRET_KEY'), // Sentinel Secret Key for verify()
    'base_url'      => 'https://redeyed.com/api/v1',   // developer API base (AI/IP/account)
    'site_base_url' => 'https://redeyed.com',          // Sentinel verify base (/sentinel/siteverify)
    'timeout'       => 60,                              // seconds
]);
```

License
-------

[](#license)

MIT © Redeyed Corporation. Support:

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance94

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Total

2

Last Release

29d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5244208523531156be8603e3bb5a526fdc7857cf27610cbbfddcd9cf8fe51d68?d=identicon)[Bruted](/maintainers/Bruted)

---

Top Contributors

[![Bruted](https://avatars.githubusercontent.com/u/73144421?v=4)](https://github.com/Bruted "Bruted (4 commits)")

---

Tags

sdkaicaptchasentinelbot-detectionip reputationredeyed

### Embed Badge

![Health badge](/badges/redeyed-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/redeyed-sdk/health.svg)](https://phpackages.com/packages/redeyed-sdk)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47394.5k5](/packages/deepseek-php-deepseek-php-client)[mozex/anthropic-php

PHP client for the Anthropic API: messages, streaming, tool use, thinking, web search, code execution, batches, and more.

48614.7k20](/packages/mozex-anthropic-php)[claude-php/claude-php-sdk-laravel

Laravel integration for the Claude PHP SDK - Anthropic Claude API

5226.7k](/packages/claude-php-claude-php-sdk-laravel)[erdum/php-open-ai-assistant-sdk

A PHP class for seamless interaction with the OpenAI Assistant API, enabling developers build powerful AI assistants capable of performing a variety of tasks.

203.5k](/packages/erdum-php-open-ai-assistant-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
