Skip to content

akumi-cloud/php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Akumi PHP SDK

The official PHP client for Akumi, the EU-sovereign, OpenAI-compatible inference API. One base_url for every model, governed and metered, with your regulated data kept in the EU.

  • Drop-in OpenAI-compatible. Chat completions, embeddings, and models under one key.
  • EU-sovereign by default. Requests run on EU-resident models unless you explicitly allow otherwise; the egress guard fails closed.
  • Governed, not just hosted. PII firewall, per-request residency, and a metadata-only audit trail come with every call.
  • Dependable. Streaming responses and automatic retries on transient errors.

Requirements

PHP 8.2 or newer.

Install

composer require akumi-cloud/sdk

Quickstart

Create an API key under app.akumi.cloud -> Platform -> API keys, then:

use Akumi\Sdk\Akumi;

$akumi = Akumi::fromApiKey('mk_...');

$response = $akumi->chat->create([
    'model' => 'mistral/mistral-large-latest',
    'messages' => [
        ['role' => 'user', 'content' => 'Explain EU data residency in one sentence.'],
    ],
]);

echo $response['choices'][0]['message']['content'];

Streaming

createStreamed() returns a generator of OpenAI-compatible chunks:

foreach ($akumi->chat->createStreamed([
    'model' => 'mistral/mistral-large-latest',
    'messages' => [['role' => 'user', 'content' => 'Write a haiku about Frankfurt.']],
]) as $chunk) {
    echo $chunk['choices'][0]['delta']['content'] ?? '';
}

Embeddings

$embeddings = $akumi->embeddings->create([
    'model' => 'mistral/mistral-embed',
    'input' => 'The quarterly report is ready for review.',
]);

$vector = $embeddings['data'][0]['embedding'];

More resources

Resource Call
List available models $akumi->models->list()
Long-term memory $akumi->memory->forget([...])
Conversation threads $akumi->memoryThreads->list()
Audit logs $akumi->auditLogs->list()

Configuration

fromApiKey() connects to https://api.akumi.cloud/v1 and retries transient failures (429, 502, 503, 504) automatically. Pass a base URL to target another host.

Documentation

About

This SDK is generated from the Akumi OpenAPI specification, so it tracks the API automatically. Found a bug? Open an issue at https://github.com/akumi-cloud/php-sdk.

MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages